Skip to content

Commit

Permalink
Rollup merge of rust-lang#104572 - pkubaj:patch-1, r=cuviper
Browse files Browse the repository at this point in the history
Fix build on powerpc-unknown-freebsd

Probably also fixes build on arm and mips*. Related to rust-lang#104220
  • Loading branch information
matthiaskrgr authored Nov 24, 2022
2 parents 1dda298 + cbeec86 commit 3c10e8b
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions compiler/rustc_llvm/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,18 +237,21 @@ fn main() {

if !is_crossed {
cmd.arg("--system-libs");
} else if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=shell32");
println!("cargo:rustc-link-lib=uuid");
} else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
println!("cargo:rustc-link-lib=z");
} else if target.starts_with("arm")
}

if target.starts_with("arm")
|| target.starts_with("mips-")
|| target.starts_with("mipsel-")
|| target.starts_with("powerpc-")
{
// 32-bit targets need to link libatomic.
println!("cargo:rustc-link-lib=atomic");
println!("cargo:rustc-link-lib=z");
} else if target.contains("windows-gnu") {
println!("cargo:rustc-link-lib=shell32");
println!("cargo:rustc-link-lib=uuid");
} else if target.contains("netbsd") || target.contains("haiku") || target.contains("darwin") {
println!("cargo:rustc-link-lib=z");
}
cmd.args(&components);

Expand Down

0 comments on commit 3c10e8b

Please sign in to comment.