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 @@ fn infer_from(
|
||||
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