dev-util/perf-6.2-r1[clang] fails to build with sys-devel/clang:16 since apparently from this LLVM / Clang version their header files started to make use of C++17 features while perf Makefiles force the C++ standard to C++14.
Created attachment 859875 [details, diff] fix The attached patch fixes the issue for me.
Please attach a build log showing the failure.
> >>> Compiling source in /var/tmp/portage/dev-util/perf-6.2-r1/work/linux-6.2/tools/perf ... > make: Entering directory '/var/tmp/portage/dev-util/perf-6.2-r1/work/linux-6.2/tools/build/feature' > x86_64-pc-linux-gnu-clang++ -O3 -pipe -march=znver1 -MD -Wall -Werror -o test-clang.bin test-clang.cpp -Wl,-O1 -Wl,--as-needed > test-clang.make.output 2>&1 -std=gnu++14 \ > -I/usr/lib64/llvm/16/include \ > -L/usr/lib64/llvm/16/lib64 \ > -lclang-cpp -lLLVM-16 \ > \ > > test-clang.make.output 2>&1 > make: *** [Makefile:355: test-clang.bin] Error 1 > make: Leaving directory '/var/tmp/portage/dev-util/perf-6.2-r1/work/linux-6.2/tools/build/feature' > * ERROR: dev-util/perf-6.2-r1::gentoo failed (compile phase): > * (no error message) > * > * Call stack: > * ebuild.sh, line 136: Called src_compile > * environment, line 3206: Called die > * The specific snippet of code: > * make -C "${S_K}/tools/build/feature" V=1 CXX=${CHOST}-clang++ test-clang.bin || die;
Created attachment 859905 [details] test-clang.make.output test-clang.make.output showing that LLVM 16 header files reference C++17 std::variant template.
Note that it is *not* enough to change the C++ standard to gnu++17 for test-clang.bin but it has to be adjusted for the whole package - otherwise either the package will not enable clang support or it will fail to build elsewhere. My proposed fix applies the change comprehensively.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d1a3661d06ab2036402024ea792bad26b7eb2cda commit d1a3661d06ab2036402024ea792bad26b7eb2cda Author: Sam James <sam@gentoo.org> AuthorDate: 2023-04-15 05:11:21 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2023-04-15 05:11:21 +0000 dev-util/perf: fix build w/ clang 16 Closes: https://bugs.gentoo.org/904169 Thanks-to: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Sam James <sam@gentoo.org> dev-util/perf/files/perf-6.0-c++17.patch | 39 ++++++++++++++++++++++++++++++++ dev-util/perf/perf-6.0-r1.ebuild | 1 + dev-util/perf/perf-6.2-r1.ebuild | 1 + 3 files changed, 41 insertions(+)