dev-util/bpf-linker: Fix build for libc++

llvm-sys[0] by default tries to link to libstc++ and any alternative
linker needs to be mentioned in the `LLVM_SYS_LIBCPP` environment
variable.

[0] https://crates.io/crates/llvm-sys

Closes: https://bugs.gentoo.org/965011
Signed-off-by: Michal Rostecki <vadorovsky@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/44296
Closes: https://github.com/gentoo/gentoo/pull/44296
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michal Rostecki 2025-10-22 16:37:42 +02:00 committed by Michał Górny
parent 2db933d775
commit b65390555d
No known key found for this signature in database
GPG Key ID: 639ADAE2329E240E

View File

@ -15,7 +15,7 @@ declare -A GIT_CRATES=(
LLVM_COMPAT=( {20..21} )
RUST_REQ_USE="llvm_targets_BPF(+),rust_sysroots_bpf(-)"
inherit cargo llvm-r2
inherit cargo llvm-r2 toolchain-funcs
DESCRIPTION="Simple BPF static linker"
HOMEPAGE="https://github.com/aya-rs/bpf-linker/"
@ -72,4 +72,8 @@ src_configure() {
cargo_src_configure --no-default-features
export "LLVM_SYS_${LLVM_SLOT}1_PREFIX"="$(get_llvm_prefix -d)"
if [[ $(tc-get-cxx-stdlib) == "libc++" ]]; then
export LLVM_SYS_LIBCPP=c++
fi
}