commit:     e576dd19c0e1bdc56ad8e9f356490f456f8dc604
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Sun Nov  7 20:58:15 2021 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Sun Nov  7 20:58:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e576dd19

dev-util/bpftrace: Statically link (partially), avoid stripping bpftrace

bpftrace is currently broken due to BEGIN_trigger symbol missing. To fix this,
we need to avoid stripping the binary since it clearly needs to have
symbols to work properly, and we also need to link some of the libraries
statically into the binary, namely some internal libraries provided by
bpftrace need to be statically linked, otherwise the binary will still
end up missing the needed symbol (upstream issue -
https://github.com/iovisor/bpftrace/issues/954). For previous versions
it was enough to skip stripping the binary, but BEGIN_trigger symbol was
moved to libbpftrace several versions ago, so even if it is present as
a .so library the symbol won't be found.

Closes: https://bugs.gentoo.org/809362
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild 
b/dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild
index efe4e68822d..4435e4c8379 100644
--- a/dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild
+++ b/dev-util/bpftrace/bpftrace-0.14.0-r3.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit toolchain-funcs llvm linux-info cmake
+inherit llvm linux-info cmake
 
 DESCRIPTION="High-level tracing language for eBPF"
 HOMEPAGE="https://github.com/iovisor/bpftrace";
@@ -67,6 +67,7 @@ pkg_setup() {
 src_configure() {
        local -a mycmakeargs=(
                -DSTATIC_LINKING:BOOL=OFF
+               -DBUILD_SHARED_LIBS:=OFF
                -DBUILD_TESTING:BOOL=OFF
                -DBUILD_FUZZ:BOOL=$(usex fuzzing)
                -DENABLE_MAN:BOOL=OFF
@@ -77,5 +78,6 @@ src_configure() {
 
 src_install() {
        cmake_src_install
+       dostrip -x /usr/bin/bpftrace
        doman man/man8/*.?
 }

Reply via email to