Update libunwind dependencies for musl · rust-lang/rust@c964567 (original) (raw)
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -16,7 +16,7 @@ fn main() { | ||
16 | 16 | |
17 | 17 | if target.contains("linux") { |
18 | 18 | if target.contains("musl") && !target.contains("mips") { |
19 | -println!("cargo:rustc-link-lib=static=unwind"); | |
19 | +// musl is handled in lib.rs | |
20 | 20 | } else if !target.contains("android") { |
21 | 21 | println!("cargo:rustc-link-lib=gcc_s"); |
22 | 22 | } |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -15,6 +15,7 @@ | ||
15 | 15 | #![deny(warnings)] |
16 | 16 | |
17 | 17 | #![feature(cfg_target_vendor)] |
18 | +#![feature(link_cfg)] | |
18 | 19 | #![feature(staged_api)] |
19 | 20 | #![feature(unwind_attributes)] |
20 | 21 | #![feature(static_nobundle)] |
@@ -28,3 +29,8 @@ extern crate libc; | ||
28 | 29 | mod libunwind; |
29 | 30 | #[cfg(not(target_env = "msvc"))] |
30 | 31 | pub use libunwind::*; |
32 | + | |
33 | +#[cfg(target_env = "musl")] | |
34 | +#[link(name = "unwind", kind = "static-nobundle", cfg(target_feature = "crt-static"))] | |
35 | +#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))] | |
36 | +extern {} |