Skip to content

Commit

Permalink
Backport LLVM patch to fix LLVM build on GCC 11
Browse files Browse the repository at this point in the history
GCC 11 has changed header dependencies again, so the build of LLVM
fails because <limits> wasn't being included when it should be. This
is already fixed upstream in LLVM 12.
  • Loading branch information
imciner2 authored and vchuravy committed Jan 12, 2021
1 parent 2bbd5fb commit 4935775
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions deps/llvm.mk
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,7 @@ $(eval $(call LLVM_PATCH,llvm-julia-tsan-custom-as))
$(eval $(call LLVM_PATCH,llvm-9.0-D85499)) # landed as D85553
$(eval $(call LLVM_PATCH,llvm-D80101)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-D84031)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-rGb498303066a6-gcc11-header-fix)) # remove for LLVM 12
endif # LLVM_VER 9.0

ifeq ($(LLVM_VER_SHORT),10.0)
Expand All @@ -508,6 +509,7 @@ $(eval $(call LLVM_PATCH,llvm-10-unique_function_clang-sa))
ifeq ($(BUILD_LLVM_CLANG),1)
$(eval $(call LLVM_PATCH,llvm-D88630-clang-cmake))
endif
$(eval $(call LLVM_PATCH,llvm-rGb498303066a6-gcc11-header-fix)) # remove for LLVM 12
endif # LLVM_VER 10.0

ifeq ($(LLVM_VER_SHORT),11.0)
Expand Down Expand Up @@ -535,6 +537,7 @@ $(eval $(call LLVM_PATCH,llvm-11-D93092-ppc-knownbits)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-D93154-globalisel-as))
$(eval $(call LLVM_PATCH,llvm-11-ppc-half-ctr)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-11-ppc-sp-from-bp)) # remove for LLVM 12
$(eval $(call LLVM_PATCH,llvm-rGb498303066a6-gcc11-header-fix)) # remove for LLVM 12
endif # LLVM_VER 11.0


Expand Down
21 changes: 21 additions & 0 deletions deps/patches/llvm-rGb498303066a6-gcc11-header-fix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From b498303066a63a203d24f739b2d2e0e56dca70d1 Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton@redhat.com>
Date: Tue, 10 Nov 2020 14:55:25 +0100
Subject: [PATCH] [nfc] Fix missing include

---
llvm/utils/benchmark/src/benchmark_register.h | 1 +
1 file changed, 1 insertion(+)

diff --git a/llvm/utils/benchmark/src/benchmark_register.h b/llvm/utils/benchmark/src/benchmark_register.h
index 0705e219f2fa..4caa5ad4da07 100644
--- a/utils/benchmark/src/benchmark_register.h
+++ b/utils/benchmark/src/benchmark_register.h
@@ -1,6 +1,7 @@
#ifndef BENCHMARK_REGISTER_H
#define BENCHMARK_REGISTER_H

+#include <limits>
#include <vector>

#include "check.h"

0 comments on commit 4935775

Please sign in to comment.