about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-06-25 15:14:08 +0200
committerGitHub <noreply@github.com>2022-06-25 15:14:08 +0200
commit45ef23d78e54ff2d12db78c6445f766f61972c86 (patch)
tree592f52e6280b405ee0e0ee8a321ef30a43e4bddf
parenta13052118994c3c39a6ce9f9fc281a529f0063d4 (diff)
parentada2accf8e659900c02e1f9a5f4015ae6d68f33e (diff)
downloadrust-45ef23d78e54ff2d12db78c6445f766f61972c86.tar.gz
rust-45ef23d78e54ff2d12db78c6445f766f61972c86.zip
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`````
-rw-r--r--compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
index f1087db09d1..1b94c59b55f 100644
--- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
+++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
@@ -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();
@@ -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,