mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 08:13:41 +00:00
Rollup merge of #56349 - davidtwco:issue-55396-inference-extension, r=nagisa
rustc 1.30.0's linker flavor inference is a non-backwards compat change to -Clinker Part of #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
This commit is contained in:
commit
cb9add6303
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user