]> git.lizzy.rs Git - rust.git/commitdiff
std: Link to gcc_s on NetBSD
authorAlex Crichton <alex@alexcrichton.com>
Mon, 21 Mar 2016 18:23:44 +0000 (11:23 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Mon, 21 Mar 2016 18:23:44 +0000 (11:23 -0700)
Currently the nightlies we're producing fail when linking some C code into a
Rust application with the error message:

    libgcc_s.so.1: error adding symbols: DSO missing from command line

By linking `gcc_s` instead of `gcc` this error goes away. I haven't tested this
on NetBSD itself, but should help get the Linux cross-compile image moreso up
and working!

src/libstd/build.rs

index 4a835e9f5030284679e54e44d4fd000027f04cef..c32bca82bd5a0da00020956eb8f9478ddc3e0cc8 100644 (file)
@@ -50,7 +50,9 @@ fn main() {
 
         if target.contains("rumprun") {
             println!("cargo:rustc-link-lib=unwind");
-        } else if target.contains("netbsd") || target.contains("openbsd") {
+        } else if target.contains("netbsd") {
+            println!("cargo:rustc-link-lib=gcc_s");
+        } else if target.contains("openbsd") {
             println!("cargo:rustc-link-lib=gcc");
         } else if target.contains("bitrig") {
             println!("cargo:rustc-link-lib=c++abi");