Skip to content

Commit 45ef23d

Browse files
authored
Rollup merge of #98149 - hoodmane:emscripten-pic, r=petrochenkov
Set relocation_model to Pic on emscripten target So we can support dynamically linking libraries with Emscripten (otherwise we need to use nightly and `-Zbuild-std` to rebuild std with relocations). `````@sbc100`````
2 parents a130521 + ada2acc commit 45ef23d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::{cvs, wasm_base};
2-
use super::{LinkArgs, LinkerFlavor, PanicStrategy, Target, TargetOptions};
2+
use super::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions};
33

44
pub fn target() -> Target {
55
let mut options = wasm_base::options();
@@ -26,6 +26,7 @@ pub fn target() -> Target {
2626
// functionality, and a .wasm file.
2727
exe_suffix: ".js".into(),
2828
linker: None,
29+
relocation_model: RelocModel::Pic,
2930
panic_strategy: PanicStrategy::Unwind,
3031
no_default_libraries: false,
3132
post_link_args,

0 commit comments

Comments
 (0)