]> git.lizzy.rs Git - rust.git/commitdiff
Update libunwind dependencies for musl
authorSamuel Holland <samuel@sholland.org>
Tue, 22 Aug 2017 21:24:29 +0000 (16:24 -0500)
committerSamuel Holland <samuel@sholland.org>
Tue, 22 Aug 2017 21:24:29 +0000 (16:24 -0500)
Use libgcc_s when linking dynamically. Convert the static libunwind to
static-nobundle, as libunwind.a is copied from musl_root and available
in the library search path.

src/libunwind/build.rs
src/libunwind/lib.rs

index cb8cb90e9ca7afac208baafed43bcc180d32c542..dc1464b905b0dacb95167815183f1008de61c3c8 100644 (file)
@@ -16,7 +16,7 @@ fn main() {
 
     if target.contains("linux") {
         if target.contains("musl") && !target.contains("mips") {
-            println!("cargo:rustc-link-lib=static=unwind");
+            // musl is handled in lib.rs
         } else if !target.contains("android") {
             println!("cargo:rustc-link-lib=gcc_s");
         }
index d4d52322adab0e5955b8ab98d1210e060337c64a..1ff0a1e19d7b312e6a3f12bfd3bdd60d577fab47 100644 (file)
@@ -15,6 +15,7 @@
 #![deny(warnings)]
 
 #![feature(cfg_target_vendor)]
+#![feature(link_cfg)]
 #![feature(staged_api)]
 #![feature(unwind_attributes)]
 #![feature(static_nobundle)]
@@ -28,3 +29,8 @@
 mod libunwind;
 #[cfg(not(target_env = "msvc"))]
 pub use libunwind::*;
+
+#[cfg(target_env = "musl")]
+#[link(name = "unwind", kind = "static-nobundle", cfg(target_feature = "crt-static"))]
+#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
+extern {}