Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ pub fn get_linker(sess: &Session) -> (PathBuf, Command, Vec<(OsString, OsString)
// was tagged as #42791) and some more info can be found on #44443 for
// emscripten itself.
let cmd = |linker: &Path| {
if cfg!(windows) && linker.ends_with(".bat") {
let mut cmd = Command::new("cmd");
cmd.arg("/c").arg(linker);
cmd
} else {
Command::new(linker)
if let Some(linker) = linker.to_str() {
if cfg!(windows) && linker.ends_with(".bat") {
let mut cmd = Command::new("cmd");
cmd.arg("/c").arg(linker);
return cmd
}
}
Command::new(linker)
};

if let Some(ref linker) = sess.opts.cg.linker {
Expand Down