Skip to content

Commit

Permalink
Auto merge of rust-lang#108996 - pnkfelix:rollback-part-of-pr-104137-…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
bors committed Mar 29, 2023
2 parents f98598c + 167623a commit 17c1167
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_target/src/spec/wasm_base.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use super::crt_objects::LinkSelfContainedDefault;
use super::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel};

pub fn options() -> TargetOptions {
Expand Down Expand Up @@ -94,6 +95,13 @@ pub fn options() -> TargetOptions {

pre_link_args,

// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
//
// rust-lang/rust#104137: cannot blindly remove this without putting in
// some other way to compensate for lack of `-nostartfiles` in linker
// invocation.
link_self_contained: LinkSelfContainedDefault::True,

// This has no effect in LLVM 8 or prior, but in LLVM 9 and later when
// PIC code is implemented this has quite a drastic effect if it stays
// at the default, `pic`. In an effort to keep wasm binaries as minimal
Expand Down

0 comments on commit 17c1167

Please sign in to comment.