Skip to content

fix(emscripten): Set -fPIC - #2097

Open
madsmtm wants to merge 2 commits into
rust-lang:mainfrom
nobodywho-ooo:emscripten-fpic
Open

madsmtm wants to merge 2 commits into
rust-lang:mainfrom
nobodywho-ooo:emscripten-fpic

Conversation

@madsmtm

@madsmtm madsmtm commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

This matches what's done in the Rust wasm32-unknown-emscripten target:
https://github.com/rust-lang/rust/blob/1.99.1/compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs#L21

Disclaimer: I'm filing this PR because I ran into an error from this at $work. The linker error is something like this:

wasm-ld: error: ./target/wasm32-unknown-emscripten/debug/deps/libllama_cpp_sys_2-2b621f5d26c7fa27.rlib(ggml.c.o): relocation R_WASM_MEMORY_ADDR_SLEB cannot be used against symbol `type_traits`; recompile with -fPIC

This matches what's done in the Rust target.
@madsmtm madsmtm changed the title Set -fPIC on Emscripten fix(emscripten): Set -fPIC Nov 11, 2026

This branch has not been deployed

No deployments
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