summaryrefslogtreecommitdiff
path: root/dev-util/perf/files
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-04-16 13:07:24 +0100
committerV3n3RiX <venerix@koprulu.sector>2022-04-16 13:07:24 +0100
commit0c100b7dd2b30e75b799d806df4ef899fd98e1ea (patch)
tree464c922e949c7e4d5d891fb2cdda5daee5612537 /dev-util/perf/files
parente68d405c5d712af4387159df07e226217bdda049 (diff)
gentoo resync : 16.04.2022
Diffstat (limited to 'dev-util/perf/files')
-rw-r--r--dev-util/perf/files/perf-5.17.1-clang.patch61
1 files changed, 61 insertions, 0 deletions
diff --git a/dev-util/perf/files/perf-5.17.1-clang.patch b/dev-util/perf/files/perf-5.17.1-clang.patch
new file mode 100644
index 000000000000..73d4506146c0
--- /dev/null
+++ b/dev-util/perf/files/perf-5.17.1-clang.patch
@@ -0,0 +1,61 @@
+
+Fix building against LLVM/Clang with monolithic libraries and
+adjust header includes for Clang >= 14.
+
+--- a/tools/build/feature/Makefile
++++ b/tools/build/feature/Makefile
+@@ -299,7 +299,7 @@ $(OUTPUT)test-llvm.bin:
+ $(BUILDXX) -std=gnu++14 \
+ -I$(shell $(LLVM_CONFIG) --includedir) \
+ -L$(shell $(LLVM_CONFIG) --libdir) \
+- $(shell $(LLVM_CONFIG) --libs Core BPF) \
++ $(shell $(LLVM_CONFIG) --libs) \
+ $(shell $(LLVM_CONFIG) --system-libs) \
+ > $(@:.bin=.make.output) 2>&1
+
+@@ -312,10 +312,7 @@ $(OUTPUT)test-clang.bin:
+ $(BUILDXX) -std=gnu++14 \
+ -I$(shell $(LLVM_CONFIG) --includedir) \
+ -L$(shell $(LLVM_CONFIG) --libdir) \
+- -Wl,--start-group -lclangBasic -lclangDriver \
+- -lclangFrontend -lclangEdit -lclangLex \
+- -lclangAST -Wl,--end-group \
+- $(shell $(LLVM_CONFIG) --libs Core option) \
++ -lclang-cpp $(shell $(LLVM_CONFIG) --libs) \
+ $(shell $(LLVM_CONFIG) --system-libs) \
+ > $(@:.bin=.make.output) 2>&1
+
+--- a/tools/perf/Makefile.perf
++++ b/tools/perf/Makefile.perf
+@@ -417,14 +417,11 @@ EXTLIBS := $(call filter-out,$(EXCLUDE_EXTLIBS),$(EXTLIBS))
+ LIBS = -Wl,--whole-archive $(PERFLIBS) $(EXTRA_PERFLIBS) -Wl,--no-whole-archive -Wl,--start-group $(EXTLIBS) -Wl,--end-group
+
+ ifeq ($(USE_CLANG), 1)
+- CLANGLIBS_LIST = AST Basic CodeGen Driver Frontend Lex Tooling Edit Sema Analysis Parse Serialization
+- CLANGLIBS_NOEXT_LIST = $(foreach l,$(CLANGLIBS_LIST),$(shell $(LLVM_CONFIG) --libdir)/libclang$(l))
+- LIBCLANG = $(foreach l,$(CLANGLIBS_NOEXT_LIST),$(wildcard $(l).a $(l).so))
+- LIBS += -Wl,--start-group $(LIBCLANG) -Wl,--end-group
++ LIBS += -lclang-cpp
+ endif
+
+ ifeq ($(USE_LLVM), 1)
+- LIBLLVM = $(shell $(LLVM_CONFIG) --libs all) $(shell $(LLVM_CONFIG) --system-libs)
++ LIBLLVM = $(shell $(LLVM_CONFIG) --libs) $(shell $(LLVM_CONFIG) --system-libs)
+ LIBS += -L$(shell $(LLVM_CONFIG) --libdir) $(LIBLLVM)
+ endif
+
+--- a/tools/perf/util/c++/clang.cpp
++++ b/tools/perf/util/c++/clang.cpp
+@@ -20,7 +20,11 @@
+ #include "llvm/Option/Option.h"
+ #include "llvm/Support/FileSystem.h"
+ #include "llvm/Support/ManagedStatic.h"
++#if CLANG_VERSION_MAJOR >= 14
++#include "llvm/MC/TargetRegistry.h"
++#else
+ #include "llvm/Support/TargetRegistry.h"
++#endif
+ #include "llvm/Support/TargetSelect.h"
+ #include "llvm/Target/TargetMachine.h"
+ #include "llvm/Target/TargetOptions.h"
+