Skip to content

Commit bc6bbc3

Browse files
committed
auto merge of rust-lang#15869 : alexcrichton/rust/issue-15828, r=kballard
Closes rust-lang#15828
2 parents 31c908b + 6ebbc6c commit bc6bbc3

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

src/librustc/back/link.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,16 @@ pub fn filename_for_input(sess: &Session,
937937
config::CrateTypeStaticlib => {
938938
out_filename.with_filename(format!("lib{}.a", libname))
939939
}
940-
config::CrateTypeExecutable => out_filename.clone(),
940+
config::CrateTypeExecutable => {
941+
match sess.targ_cfg.os {
942+
abi::OsWin32 => out_filename.with_extension("exe"),
943+
abi::OsMacos |
944+
abi::OsLinux |
945+
abi::OsAndroid |
946+
abi::OsFreebsd |
947+
abi::OsiOS => out_filename.clone(),
948+
}
949+
}
941950
}
942951
}
943952

src/test/run-make/crate-data-smoke/Makefile

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
all:
44
[ `$(RUSTC) --print-crate-name crate.rs` = "foo" ]
5-
[ `$(RUSTC) --print-file-name crate.rs` = "foo" ]
6-
[ `$(RUSTC) --print-file-name --crate-type=lib --test crate.rs` = "foo" ]
7-
[ `$(RUSTC) --print-file-name --test lib.rs` = "mylib" ]
5+
[ `$(RUSTC) --print-file-name crate.rs` = "$(call BIN,foo)" ]
6+
[ `$(RUSTC) --print-file-name --crate-type=lib \
7+
--test crate.rs` = "$(call BIN,foo)" ]
8+
[ `$(RUSTC) --print-file-name --test lib.rs` = "$(call BIN,mylib)" ]
89
$(RUSTC) --print-file-name lib.rs
910
$(RUSTC) --print-file-name rlib.rs

0 commit comments

Comments
 (0)