Skip to content

Commit 7bce15d

Browse files
taiki-eMark-Simulacrum
authored andcommitted
Fix linker detection for clang with prefix
1 parent 775805a commit 7bce15d

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
@@ -1237,15 +1237,17 @@ pub fn linker_and_flavor(sess: &Session) -> (PathBuf, LinkerFlavor) {
12371237
.and_then(|(lhs, rhs)| rhs.chars().all(char::is_numeric).then_some(lhs))
12381238
.unwrap_or(stem);
12391239

1240-
// GCC can have an optional target prefix.
1240+
// GCC/Clang can have an optional target prefix.
12411241
let flavor = if stem == "emcc" {
12421242
LinkerFlavor::EmCc
12431243
} else if stem == "gcc"
12441244
|| stem.ends_with("-gcc")
12451245
|| stem == "g++"
12461246
|| stem.ends_with("-g++")
12471247
|| stem == "clang"
1248+
|| stem.ends_with("-clang")
12481249
|| stem == "clang++"
1250+
|| stem.ends_with("-clang++")
12491251
{
12501252
LinkerFlavor::from_cli(LinkerFlavorCli::Gcc, &sess.target)
12511253
} else if stem == "wasm-ld" || stem.ends_with("-wasm-ld") {

0 commit comments

Comments
 (0)