Skip to content

fix(libgvproxy-sys): force static linking of libresolv on Linux#382

Merged
DorianZheng merged 1 commit intomainfrom
fix/static-resolv-linking
Mar 14, 2026
Merged

fix(libgvproxy-sys): force static linking of libresolv on Linux#382
DorianZheng merged 1 commit intomainfrom
fix/static-resolv-linking

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Force static=resolv linking on Linux to ensure boxlite-shim remains fully statically linked when built with crt-static
  • Add explicit library search paths for both Debian/Ubuntu (/usr/lib/<triple>) and RHEL/manylinux (/usr/lib64) so the linker finds libresolv.a when building with --target
  • Without this fix, the linker picks libresolv.so (dynamic), producing a dynamically linked shim binary that SIGSEGV on TLS access (fs:[0x28]) on some VMs

Test plan

  • Built shim on GCE Ubuntu VM — file confirms statically linked, ldd reports "not a dynamic executable"
  • Ran boxlite-rust-example on GCE VM — "Hello from BoxLite!" (no SIGSEGV)
  • Built libgvproxy-sys in manylinux_2_28_x86_64 Docker container — resolv linked via /usr/lib64/libresolv.a
  • Verified v0.7.0 (static) shim works, v0.7.4 (dynamic) shim crashes — confirms root cause

Without this, `cargo:rustc-link-lib=resolv` links libresolv.so
dynamically, defeating crt-static and producing a dynamically linked
boxlite-shim binary that SIGSEGV on TLS access (fs:[0x28]) on some VMs.

Force `static=resolv` on Linux and add explicit library search paths for
both Debian/Ubuntu (/usr/lib/<triple>) and RHEL/manylinux (/usr/lib64)
so the linker can find libresolv.a when building with --target.
@DorianZheng DorianZheng merged commit 270e6c5 into main Mar 14, 2026
17 checks passed
@DorianZheng DorianZheng deleted the fix/static-resolv-linking branch March 14, 2026 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant