Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926599 - dev-util/bcc: failed to build with clang-18
Summary: dev-util/bcc: failed to build with clang-18
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick McLean
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-09 13:48 UTC by 12101111
Modified: 2024-03-15 16:17 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 12101111 2024-03-09 13:48:53 UTC
This PR in 2017 add `-nopie` to CFLAGS when compiler is clang: https://github.com/iovisor/bcc/pull/1289
LLVM 18 don't support `-nopie` any more: https://github.com/llvm/llvm-project/commit/cac82e26c642d55672b1de6f3d026826c89994ec

See also my report to upstream: https://github.com/iovisor/bcc/issues/4931

Reproducible: Always

Steps to Reproduce:
CC=$CTARGET-clang-18
emerge dev-util/bcc
Actual Results:  
[49/156] : && /usr/lib/llvm/18/bin/x86_64-pc-linux-musl-clang-18 -march=znver4 -mtune=znver4 -O3 -pipe -flto=thin -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-plt -Wall -flto=thin -Wl,--gc-sections -Wl,--lto-O3,-O3,--icf=safe -Wl,-zrelro,-znow,-ztext -march=znver4 -mtune=znver4 -O3 -pipe -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-plt    -rdynamic src/lua/bcc.o src/lua/CMakeFiles/bcc-lua.dir/src/main.c.o -o src/lua/bcc-lua  -lluajit-5.1  -Wl,-Bstatic  -ldl  -lm  -Wl,-Bdynamic  -nopie && :
FAILED: src/lua/bcc-lua
: && /usr/lib/llvm/18/bin/x86_64-pc-linux-musl-clang-18 -march=znver4 -mtune=znver4 -O3 -pipe -flto=thin -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-plt -Wall -flto=thin -Wl,--gc-sections -Wl,--lto-O3,-O3,--icf=safe -Wl,-zrelro,-znow,-ztext -march=znver4 -mtune=znver4 -O3 -pipe -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-plt    -rdynamic src/lua/bcc.o src/lua/CMakeFiles/bcc-lua.dir/src/main.c.o -o src/lua/bcc-lua  -lluajit-5.1  -Wl,-Bstatic  -ldl  -lm  -Wl,-Bdynamic  -nopie && :
x86_64-pc-linux-musl-clang-18: error: unsupported option '-nopie' for target 'x86_64-pc-linux-musl'



https://github.com/iovisor/bcc/commit/24eeae24265ae3143f398546b2958dd441bcd866

This commit provide a way to fix it without any patch

For the distro with PIE luajit,
just add the following build option:

   -DENABLE_NO_PIE=OFF

Then, bcc-lua will be built with PIE support.
Comment 1 Larry the Git Cow gentoo-dev 2024-03-15 16:17:21 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e08e70cec455eb478e9331e2a1060accdc52c0ae

commit e08e70cec455eb478e9331e2a1060accdc52c0ae
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2024-03-15 16:14:05 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2024-03-15 16:17:12 +0000

    dev-util/bcc: -DENABLE_NO_PIE=OFF
    
    Closes: https://bugs.gentoo.org/926599
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 dev-util/bcc/bcc-0.29.1-r2.ebuild | 141 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 141 insertions(+)