diff options
| author | bors <bors@rust-lang.org> | 2022-12-09 12:00:58 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-12-09 12:00:58 +0000 |
| commit | e10201c9bb8e225095d76e6650dcfe8dadc50327 (patch) | |
| tree | 654edc9d1a3f8fd9282c432caa4ac593fc7e1b7c /compiler/rustc_llvm/build.rs | |
| parent | 14ca83a04b00433a8caf3b805d5ea08cb2691e1b (diff) | |
| parent | 32c777e89157ad7c9784ef6944c109b6d1e9b411 (diff) | |
| download | rust-e10201c9bb8e225095d76e6650dcfe8dadc50327.tar.gz rust-e10201c9bb8e225095d76e6650dcfe8dadc50327.zip | |
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 https://github.com/rust-lang/rust/issues/104220
Diffstat (limited to 'compiler/rustc_llvm/build.rs')
| -rw-r--r-- | compiler/rustc_llvm/build.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs index 79f06ac146c..0b3c057345a 100644 --- a/compiler/rustc_llvm/build.rs +++ b/compiler/rustc_llvm/build.rs @@ -238,18 +238,20 @@ 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.contains("freebsd")) || 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"); + } 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); |
