Skip to content

Commit 4558c70

Browse files
taiki-eMark-Simulacrum
authored andcommitted
Fix linker detection for clang with prefix
1 parent 1ecd9ad commit 4558c70

File tree

1 file changed

+3
-1
lines changed
  • compiler/rustc_codegen_ssa/src/back

1 file changed

+3
-1
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1199,15 +1199,17 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
11991199
.and_then(|(lhs, rhs)| rhs.chars().all(char::is_numeric).then_some(lhs))
12001200
.unwrap_or(stem);
12011201

1202-
// GCC can have an optional target prefix.
1202+
// GCC/Clang can have an optional target prefix.
12031203
let flavor = if stem == "emcc" {
12041204
LinkerFlavor::EmCc
12051205
} else if stem == "gcc"
12061206
|| stem.ends_with("-gcc")
12071207
|| stem == "g++"
12081208
|| stem.ends_with("-g++")
12091209
|| stem == "clang"
1210+
|| stem.ends_with("-clang")
12101211
|| stem == "clang++"
1212+
|| stem.ends_with("-clang++")
12111213
{
12121214
LinkerFlavor::from_cli(LinkerFlavorCli::Gcc, &sess.target)
12131215
} else if stem == "wasm-ld" || stem.ends_with("-wasm-ld") {

0 commit comments

Comments
 (0)