fix(build): switch shim from musl to glibc static linking#319
Merged
DorianZheng merged 1 commit intomainfrom Mar 1, 2026
Merged
fix(build): switch shim from musl to glibc static linking#319DorianZheng merged 1 commit intomainfrom
DorianZheng merged 1 commit intomainfrom
Conversation
Go c-archive (libgvproxy) is fundamentally incompatible with musl TLS, causing SIGSEGV at runtime. Replace musl target with gnu + crt-static for a fully static binary using glibc's static libraries. Key changes: - Revert musl compat commits (#317, #318) that are no longer needed - Use x86_64-unknown-linux-gnu with +crt-static and relocation-model=static - Add link-krun feature to gate libkrun.a linking (shim-only) - Feature-gate krun VMM module so boxlite-cli doesn't link libkrun.a - Remove shim pre-build from CI (builds natively in manylinux container) - Remove configure_library_env dependency on krun_create_ctx symbol --target is required on Linux so RUSTFLAGS don't affect proc-macro compilation. relocation-model=static avoids static-pie which crashes with Go c-archive relocations.
DorianZheng
added a commit
that referenced
this pull request
Mar 2, 2026
Go's CGO net package calls res_search from libresolv for DNS lookups. With dynamic linking, libresolv.so is resolved transitively. After switching to glibc static linking (#319), libresolv.a must be linked explicitly since glibc separates it from libc.a. Also make glibc-static a required dependency in manylinux setup since it provides both libc.a and libresolv.a needed for +crt-static builds.
DorianZheng
added a commit
that referenced
this pull request
Mar 2, 2026
Go's CGO net package calls res_search from libresolv for DNS lookups. With dynamic linking, libresolv.so is resolved transitively. After switching to glibc static linking (#319), libresolv.a must be linked explicitly since glibc separates it from libc.a. Also make glibc-static a required dependency in manylinux setup since it provides both libc.a and libresolv.a needed for +crt-static builds.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Go c-archive (libgvproxy) is fundamentally incompatible with musl TLS, causing SIGSEGV at runtime. Replace musl target with gnu + crt-static for a fully static binary using glibc's static libraries.
Key changes:
--target is required on Linux so RUSTFLAGS don't affect proc-macro compilation. relocation-model=static avoids static-pie which crashes with Go c-archive relocations.