build: use static glibc linking for Linux releases #76
+136
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements static linking for Linux releases to improve portability across different Linux distributions.
Problem
Current Linux releases use dynamic linking, which means:
Solution
Use static glibc linking with the gnu target and
crt-static
flag:static-pie
Changes
build.rs
to configure-static-libgcc
for Linux gnu targetsscripts/build-static.sh
for building withRUSTFLAGS="-C target-feature=+crt-static"
Testing
Verified on ci-1 (Debian 12, glibc 2.36):
static-pie
)$ file httpjail httpjail: ELF 64-bit LSB pie executable, x86-64, version 1 (GNU/Linux), static-pie linked, for GNU/Linux 3.2.0, not stripped $ ldd httpjail statically linked
Benefits
Note on musl
We use gnu (glibc) instead of musl because V8 doesn't provide prebuilt musl binaries and building V8 from source for musl is not currently feasible.
🤖 Generated with Claude Code