Skip to content

fix(build): add --allow-multiple-definition for all Linux targets#318

Merged
DorianZheng merged 1 commit intomainfrom
fix/allow-multiple-definition-linker
Mar 1, 2026
Merged

fix(build): add --allow-multiple-definition for all Linux targets#318
DorianZheng merged 1 commit intomainfrom
fix/allow-multiple-definition-linker

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

libkrun.a is a Rust staticlib that bundles its own std. When linked into any binary (boxlite-shim, boxlite-cli, tests), std symbols like rust_eh_personality are duplicated, causing linker errors.

Move the flag to .cargo/config.toml so it applies to all Linux targets (glibc and musl) and all binary crates in the workspace.

libkrun.a is a Rust staticlib that bundles its own std. When linked
into any binary (boxlite-shim, boxlite-cli, tests), std symbols like
rust_eh_personality are duplicated, causing linker errors.

Move the flag to .cargo/config.toml so it applies to all Linux targets
(glibc and musl) and all binary crates in the workspace.
@DorianZheng DorianZheng merged commit cc481da into main Mar 1, 2026
@DorianZheng DorianZheng deleted the fix/allow-multiple-definition-linker branch March 1, 2026 05:34
DorianZheng added a commit that referenced this pull request Mar 1, 2026
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 1, 2026
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.
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