Skip to content

Commit

Permalink
Rollup merge of rust-lang#98149 - hoodmane:emscripten-pic, r=petroche…
Browse files Browse the repository at this point in the history
…nkov

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`
  • Loading branch information
Dylan-DPC authored Jun 24, 2022
2 parents 84c2c51 + ada2acc commit 9437b85
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use super::{cvs, wasm_base};
use super::{LinkArgs, LinkerFlavor, PanicStrategy, Target, TargetOptions};
use super::{LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions};

pub fn target() -> Target {
let mut options = wasm_base::options();
Expand All @@ -26,6 +26,7 @@ pub fn target() -> Target {
// functionality, and a .wasm file.
exe_suffix: ".js".into(),
linker: None,
relocation_model: RelocModel::Pic,
panic_strategy: PanicStrategy::Unwind,
no_default_libraries: false,
post_link_args,
Expand Down

0 comments on commit 9437b85

Please sign in to comment.