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.
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(+)