aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Richter <[email protected]>2023-07-25 17:03:47 +0200
committerArnaldo Carvalho de Melo <[email protected]>2023-08-03 17:01:28 -0300
commit8fcaea9fd0dabc33f1a18f62aa3cf3d12286cd9f (patch)
tree10bcb9e24feb0e87ca80849ca0ec20d0ad377ffb
parent4e95ed4f4d5bc6838a10e6952999b41b1d07e56f (diff)
perf build: Support llvm and clang support compiled in
Perf build suports llvm and clang support compiled in. Test case 56 builtin clang support provides a test case which is always skipped. Link perf with the latest llvm and clang libraries and enable this test case. Use 'make LIBCLANGLLVM=1' to include this support. V2: Add Library patch before -lclang-cpp Output before: # ./perf test 56 56: builtin clang support : 56.1: builtin clang compile C source to IR : Skip (not compiled in) 56.2: builtin clang compile C source to ELF object: Skip (not compiled in) Output after: # ./perf test 56 56: builtin clang support : 56.1: builtin clang compile C source to IR : Ok 56.2: builtin clang compile C source to ELF object : Ok # From Ian Rogers: Build tested with LLVM 14 and 15 using: BUILD_BPF_SKEL=1 LIBCLANGLLVM=1 LLVM_CONFIG=llvm-config-14 BUILD_BPF_SKEL=1 LIBCLANGLLVM=1 LLVM_CONFIG=llvm-config-15 Signed-off-by: Thomas Richter <[email protected]> Tested-by: Arnaldo Carvalho de Melo <[email protected]> Tested-by: Ian Rogers <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Sumanth Korikkar <[email protected]> Cc: Sven Schnelle <[email protected]> Cc: Thomas Richter <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Wang Nan <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
-rw-r--r--tools/perf/Makefile.config2
-rw-r--r--tools/perf/Makefile.perf5
2 files changed, 2 insertions, 5 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index fe7afe6d8529..1bf8dc53641f 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -331,7 +331,7 @@ CORE_CFLAGS += -Wall
CORE_CFLAGS += -Wextra
CORE_CFLAGS += -std=gnu11
-CXXFLAGS += -std=gnu++14 -fno-exceptions -fno-rtti
+CXXFLAGS += -std=gnu++17 -fno-exceptions -fno-rtti
CXXFLAGS += -Wall
CXXFLAGS += -Wextra
CXXFLAGS += -fno-omit-frame-pointer
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index a44d16ec11ee..0ed7ee0c1665 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -426,10 +426,7 @@ 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 += -L$(shell $(LLVM_CONFIG) --libdir) -lclang-cpp
endif
ifeq ($(USE_LLVM), 1)