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 <tmricht@linux.ibm.com>
Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Tested-by: Ian Rogers <irogers@google.com>
Cc: Heiko Carstens <hca@linux.ibm.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Sven Schnelle <svens@linux.ibm.com>
Cc: Thomas Richter <tmricht@linux.ibm.com>
Cc: Vasily Gorbik <gor@linux.ibm.com>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lore.kernel.org/r/20230725150347.3479291-2-tmricht@linux.ibm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
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
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)