Only consider stem when extension is exe.
This commit modifies linker flavor inference to only remove the extension to the linker when performing inference if that extension is a 'exe'.
This commit is contained in:
parent
147e60c5f8
commit
0124341935
1 changed files with 5 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue