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.
if target.contains("linux") {
if target.contains("musl") && !target.contains("mips") {
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");
}
} else if !target.contains("android") {
println!("cargo:rustc-link-lib=gcc_s");
}
#![deny(warnings)]
#![feature(cfg_target_vendor)]
#![deny(warnings)]
#![feature(cfg_target_vendor)]
#![feature(staged_api)]
#![feature(unwind_attributes)]
#![feature(static_nobundle)]
#![feature(staged_api)]
#![feature(unwind_attributes)]
#![feature(static_nobundle)]
mod libunwind;
#[cfg(not(target_env = "msvc"))]
pub use libunwind::*;
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 {}