Skip to content

Commit cbeec86

Browse files
pkubajPiotr Kubaj
authored and
Piotr Kubaj
committed
Fix build on powerpc-unknown-freebsd
Probably also fixes build on arm and mips*. Related to #104220
1 parent 30117a1 commit cbeec86

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

compiler/rustc_llvm/build.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -237,18 +237,21 @@ 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")
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+
println!("cargo:rustc-link-lib=z");
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");
252255
}
253256
cmd.args(&components);
254257

0 commit comments

Comments
 (0)