Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 904169 - dev-util/perf-6.2-r1[clang] fails to build with sys-devel/clang:16
Summary: dev-util/perf-6.2-r1[clang] fails to build with sys-devel/clang:16
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Naohiro Aota
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-04-11 15:18 UTC by Maciej S. Szmigiero
Modified: 2023-04-15 05:13 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
fix (perf-clang-16-fix.patch,1.07 KB, patch)
2023-04-11 15:19 UTC, Maciej S. Szmigiero
Details | Diff
test-clang.make.output (test-clang.make.output,5.20 KB, text/plain)
2023-04-12 08:33 UTC, Maciej S. Szmigiero
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej S. Szmigiero 2023-04-11 15:18:51 UTC
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.
Comment 1 Maciej S. Szmigiero 2023-04-11 15:19:40 UTC
Created attachment 859875 [details, diff]
fix

The attached patch fixes the issue for me.
Comment 2 Mike Gilbert gentoo-dev 2023-04-11 20:21:22 UTC
Please attach a build log showing the failure.
Comment 3 Maciej S. Szmigiero 2023-04-12 08:31:13 UTC
> >>> 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;
Comment 4 Maciej S. Szmigiero 2023-04-12 08:33:07 UTC
Created attachment 859905 [details]
test-clang.make.output

test-clang.make.output showing that LLVM 16 header files reference C++17 std::variant template.
Comment 5 Maciej S. Szmigiero 2023-04-12 08:35:51 UTC
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.
Comment 6 Larry the Git Cow gentoo-dev 2023-04-15 05:13:19 UTC
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(+)