Skip to content

Commit

Permalink
Rollup merge of rust-lang#56349 - davidtwco:issue-55396-inference-ext…
Browse files Browse the repository at this point in the history
…ension, r=nagisa

rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker

Part of rust-lang#55396.

This commit modifies linker flavor inference to only remove the extension
to the linker when performing inference if that extension is a 'exe'.

r? @nagisa
cc @alexcrichton @japaric
  • Loading branch information
kennytm authored Nov 30, 2018
2 parents 9f1a443 + 0124341 commit 1185342
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_codegen_ssa/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,11 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
LinkerFlavor::Lld(_) => "lld",
}), flavor)),
(Some(linker), None) => {
let stem = linker.file_stem().and_then(|stem| stem.to_str()).unwrap_or_else(|| {
let stem = if linker.extension().and_then(|ext| ext.to_str()) == Some("exe") {
linker.file_stem().and_then(|stem| stem.to_str())
} else {
linker.to_str()
}.unwrap_or_else(|| {
sess.fatal("couldn't extract file stem from specified linker");
}).to_owned();

Expand Down

0 comments on commit 1185342

Please sign in to comment.