Closed EHfive closed 2 days ago
OK, this is invalid.
I was also using pkg-config crate to location libbpf headers in build script, however it also implicitly produces cargo:rustc-link-search=native=<libbpf>
etc. causing system libbpf to be linked.
edit: For future reference, specifying cargo_metadata=false
with pkg_config::Config
builder can prevent it from emitting those linking instructions.
pkg_config::Config::new()
.cargo_metadata(false)
.probe("libbpf")
Thanks for getting to the bottom of it
Environment
Unexpected
libbpf.so is dynamically linked dispute (implicitly) specifying "static-libbpf".
Observed #987 when system libbpf version does not match libbpf-sys'.
Workaround
Delete system libbpf or
/usr/lib/pkgconfig/libbpf.pc
can make libbpf-sys static link to vendored libbpf again.