summaryrefslogtreecommitdiffstats
path: root/compiler/rustc_llvm/build.rs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/rustc_llvm/build.rs')
-rw-r--r--compiler/rustc_llvm/build.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
index f606fa483..fe13162cd 100644
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
@@ -258,6 +258,12 @@ fn main() {
{
println!("cargo:rustc-link-lib=z");
} else if target.contains("netbsd") {
+ // On NetBSD/i386, gcc and g++ is built for i486 (to maximize backward compat)
+ // However, LLVM insists on using 64-bit atomics.
+ // This gives rise to a need to link rust itself with -latomic for these targets
+ if target.starts_with("i586") || target.starts_with("i686") {
+ println!("cargo:rustc-link-lib=atomic");
+ }
println!("cargo:rustc-link-lib=z");
println!("cargo:rustc-link-lib=execinfo");
}