Skip to content

Commit 32c777e

Browse files
committed
Fix build on powerpc-unknown-freebsd
Probably also fixes build on mips*. Related to #104220
1 parent 30117a1 commit 32c777e

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Diff for: compiler/rustc_llvm/build.rs

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

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

0 commit comments

Comments
 (0)