Skip to content

Commit

Permalink
Make novendor feature the default
Browse files Browse the repository at this point in the history
See: libbpf/libbpf-sys#64

The "static" feature will now get libbpf-sys to do all the static compilation
of the libraries required by libbpf rather than the application developer
statically compiling these libraries themselves, or relying on the
distribution to provide static versions.

The default feature will no longer link libbpf statically.  All libbpf
libraries, including libbpf, will now be dynamically linked to
distribution provided shared libraries

CHANGELOG NOTE #1: feature "static" allows libelf and zlib to be statically
linked. Completely static binaries can now be compiled via the command
`RUSTFLAGS='-C target-feature=+crt-static' cargo build --target
x86_64-unknown-linux-gnu`.
CHANGELOG NOTE #2: "static" feature will not work with musl.

Signed-off-by: Michael Mullin <[email protected]>
  • Loading branch information
mmullin-halcyon committed Jul 18, 2023
1 parent f863ac3 commit e8a7ccc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libbpf-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,8 @@ keywords = ["bpf", "ebpf", "libbpf"]
maintenance = { status = "actively-developed" }

[features]
# When turned on, link against system-installed libbpf instead of building
# and linking against vendored libbpf sources
novendor = ["libbpf-sys/novendor"]
# When turned on, compile and link all libbpf library dependencies statically
# When turned off, dynamically link all libbpf library dependencies
static = ["libbpf-sys/static"]

[dependencies]
Expand Down

0 comments on commit e8a7ccc

Please sign in to comment.