Skip to content

Commit e10201c

Browse files
committed
Auto merge of #104572 - pkubaj:patch-1, r=cuviper
Fix build on powerpc-unknown-freebsd Probably also fixes build on arm and mips*. Related to #104220
2 parents 14ca83a + 32c777e commit e10201c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

compiler/rustc_llvm/build.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -238,18 +238,20 @@ fn main() {
238238

239239
if !is_crossed {
240240
cmd.arg("--system-libs");
241-
} else if target.contains("windows-gnu") {
242-
println!("cargo:rustc-link-lib=shell32");
243-
println!("cargo:rustc-link-lib=uuid");
244-
} else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
245-
println!("cargo:rustc-link-lib=z");
246-
} else if target.starts_with("arm")
241+
}
242+
243+
if (target.starts_with("arm") && !target.contains("freebsd"))
247244
|| target.starts_with("mips-")
248245
|| target.starts_with("mipsel-")
249246
|| target.starts_with("powerpc-")
250247
{
251248
// 32-bit targets need to link libatomic.
252249
println!("cargo:rustc-link-lib=atomic");
250+
} else if target.contains("windows-gnu") {
251+
println!("cargo:rustc-link-lib=shell32");
252+
println!("cargo:rustc-link-lib=uuid");
253+
} else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
254+
println!("cargo:rustc-link-lib=z");
253255
}
254256
cmd.args(&components);
255257

0 commit comments

Comments
 (0)