void-packages/srcpkgs/rust/patches/libunwind.patch
2019-05-27 18:05:22 +02:00

64 lines
2.6 KiB
Diff

we use libgcc_s for unwind, no need for libunwind.a
https://github.com/void-linux/void-packages/issues/3605
--- rustc-1.35.0-src/src/libunwind/build.rs
+++ rustc-1.35.0-src/src/libunwind/build.rs
@@ -11,9 +11,7 @@ fn main() {
#[cfg(feature = "llvm-libunwind")]
llvm_libunwind::compile();
} else if target.contains("linux") {
- if target.contains("musl") {
- // musl is handled in lib.rs
- } else if !target.contains("android") {
+ if !target.contains("android") {
println!("cargo:rustc-link-lib=gcc_s");
}
} else if target.contains("freebsd") {
--- rustc-1.35.0-src/src/libunwind/lib.rs
+++ rustc-1.35.0-src/src/libunwind/lib.rs
@@ -24,8 +24,3 @@ cfg_if! {
pub use libunwind::*;
}
}
-
-#[cfg(target_env = "musl")]
-#[link(name = "unwind", kind = "static", cfg(target_feature = "crt-static"))]
-#[link(name = "gcc_s", cfg(not(target_feature = "crt-static")))]
-extern {}
--- rustc-1.35.0-src/src/bootstrap/sanity.rs
+++ rustc-1.35.0-src/src/bootstrap/sanity.rs
@@ -171,34 +171,6 @@ pub fn check(build: &mut Build) {
}
}
- // Make sure musl-root is valid
- if target.contains("musl") {
- // If this is a native target (host is also musl) and no musl-root is given,
- // fall back to the system toolchain in /usr before giving up
- if build.musl_root(*target).is_none() && build.config.build == *target {
- let target = build.config.target_config.entry(target.clone())
- .or_default();
- target.musl_root = Some("/usr".into());
- }
- match build.musl_root(*target) {
- Some(root) => {
- if fs::metadata(root.join("lib/libc.a")).is_err() {
- panic!("couldn't find libc.a in musl dir: {}",
- root.join("lib").display());
- }
- if fs::metadata(root.join("lib/libunwind.a")).is_err() {
- panic!("couldn't find libunwind.a in musl dir: {}",
- root.join("lib").display());
- }
- }
- None => {
- panic!("when targeting MUSL either the rust.musl-root \
- option or the target.$TARGET.musl-root option must \
- be specified in config.toml")
- }
- }
- }
-
if target.contains("msvc") {
// There are three builds of cmake on windows: MSVC, MinGW, and
// Cygwin. The Cygwin build does not have generators for Visual