Skip to content

Commit 17c1167

Browse files
committed
Auto merge of rust-lang#108996 - pnkfelix:rollback-part-of-pr-104137-that-broke-wasm-linker-overriding, r=petrochenkov
Rollback part of pr 104137 that broke wasm linker overriding This is a quick fix to address rust-lang#108910
2 parents f98598c + 167623a commit 17c1167

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_target/src/spec/wasm_base.rs

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use super::crt_objects::LinkSelfContainedDefault;
12
use super::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel};
23

34
pub fn options() -> TargetOptions {
@@ -94,6 +95,13 @@ pub fn options() -> TargetOptions {
9495

9596
pre_link_args,
9697

98+
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
99+
//
100+
// rust-lang/rust#104137: cannot blindly remove this without putting in
101+
// some other way to compensate for lack of `-nostartfiles` in linker
102+
// invocation.
103+
link_self_contained: LinkSelfContainedDefault::True,
104+
97105
// This has no effect in LLVM 8 or prior, but in LLVM 9 and later when
98106
// PIC code is implemented this has quite a drastic effect if it stays
99107
// at the default, `pic`. In an effort to keep wasm binaries as minimal

0 commit comments

Comments
 (0)