From 4e95ed4f4d5bc6838a10e6952999b41b1d07e56f Mon Sep 17 00:00:00 2001 From: Thomas Richter Date: Tue, 25 Jul 2023 17:03:46 +0200 Subject: perf build: Update feature check for clang and llvm Perf build auto-detects features and packages already installed for its build. This is done in directory tools/build/feature. This directory contains small sample programs. When they successfully compile the necessary prereqs in form of libraries and header files are present. Such a check is also done for llvm and clang. And the checks fail. Fix this and update to the latest C++ standard and use the new library provided by clang (which contains new packaging) s/ee this link for reference: https://fedoraproject.org/wiki/Changes/Stop-Shipping-Individual-Component-Libraries-In-clang-lib-Package Output before: # rm -f ./test-clang.bin; make test-clang.bin; ./test-clang.bin; \ ll test-clang.make.output g++ -MD -Wall -Werror -o test-clang.bin test-clang.cpp \ > test-clang.make.output 2>&1 -std=gnu++14 \ -I/usr/include \ -L/usr/lib64 \ -Wl,--start-group -lclangBasic -lclangDriver \ -lclangFrontend -lclangEdit -lclangLex \ -lclangAST -Wl,--end-group \ -lLLVM-16 \ \ > test-clang.make.output 2>&1 make: *** [Makefile:356: test-clang.bin] Error 1 -bash: ./test-clang.bin: No such file or directory -rw-r--r--. 1 root root 252041 Jul 12 09:56 test-clang.make.output # File test-clang.make.output contains many lines of unreferenced symbols. Output after: # rm -f ./test-clang.bin; make test-clang.bin; ./test-clang.bin; \ cat test-clang.make.output g++ -MD -Wall -Werror -o test-clang.bin test-clang.cpp \ > test-clang.make.output 2>&1 -std=gnu++17 \ -I/usr/include \ -L/usr/lib64 \ -Wl,--start-group -lclang-cpp -Wl,--end-group \ -lLLVM-16 \ \ > test-clang.make.output 2>&1 # Committer notes: Test it in the tools/build/feature directory, and have clang-devel and llvm-devel installed. Signed-off-by: Thomas Richter Tested-by: Arnaldo Carvalho de Melo Cc: Heiko Carstens Cc: Ian Rogers Cc: Jiri Olsa Cc: Sumanth Korikkar Cc: Sven Schnelle Cc: Vasily Gorbik Cc: Wang Nan Link: https://lore.kernel.org/r/20230725150347.3479291-1-tmricht@linux.ibm.com Signed-off-by: Arnaldo Carvalho de Melo --- tools/build/feature/Makefile | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'tools/build/feature') diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile index 2cd6dbbee088..3184f387990a 100644 --- a/tools/build/feature/Makefile +++ b/tools/build/feature/Makefile @@ -340,7 +340,7 @@ $(OUTPUT)test-jvmti-cmlr.bin: $(BUILD) $(OUTPUT)test-llvm.bin: - $(BUILDXX) -std=gnu++14 \ + $(BUILDXX) -std=gnu++17 \ -I$(shell $(LLVM_CONFIG) --includedir) \ -L$(shell $(LLVM_CONFIG) --libdir) \ $(shell $(LLVM_CONFIG) --libs Core BPF) \ @@ -348,17 +348,15 @@ $(OUTPUT)test-llvm.bin: > $(@:.bin=.make.output) 2>&1 $(OUTPUT)test-llvm-version.bin: - $(BUILDXX) -std=gnu++14 \ + $(BUILDXX) -std=gnu++17 \ -I$(shell $(LLVM_CONFIG) --includedir) \ > $(@:.bin=.make.output) 2>&1 $(OUTPUT)test-clang.bin: - $(BUILDXX) -std=gnu++14 \ + $(BUILDXX) -std=gnu++17 \ -I$(shell $(LLVM_CONFIG) --includedir) \ -L$(shell $(LLVM_CONFIG) --libdir) \ - -Wl,--start-group -lclangBasic -lclangDriver \ - -lclangFrontend -lclangEdit -lclangLex \ - -lclangAST -Wl,--end-group \ + -Wl,--start-group -lclang-cpp -Wl,--end-group \ $(shell $(LLVM_CONFIG) --libs Core option) \ $(shell $(LLVM_CONFIG) --system-libs) \ > $(@:.bin=.make.output) 2>&1 -- cgit v1.2.3