From 0b7fc0653bfd19f650a2fbad987b2fe03715e6b4 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 6 Mar 2016 08:19:51 -0500 Subject: rustbuild: fix cross compilation of libstd to i686-unknown-linux-musl - make sure we copy the third party objects (crt*.o) to the target stage directory. - apply the x86_64-musl logic also to the i686-musl target. --- src/libstd/build.rs | 2 +- src/libstd/sys/common/libunwind.rs | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'src/libstd') diff --git a/src/libstd/build.rs b/src/libstd/build.rs index c60ec4d3655..1c8375479ca 100644 --- a/src/libstd/build.rs +++ b/src/libstd/build.rs @@ -28,7 +28,7 @@ fn main() { } if target.contains("unknown-linux") { - if target.contains("musl") && target.contains("x86_64") { + if target.contains("musl") && (target.contains("x86_64") || target.contains("i686")) { println!("cargo:rustc-link-lib=static=unwind"); } else { println!("cargo:rustc-link-lib=dl"); diff --git a/src/libstd/sys/common/libunwind.rs b/src/libstd/sys/common/libunwind.rs index 3f70afe6ad7..c1e9782852a 100644 --- a/src/libstd/sys/common/libunwind.rs +++ b/src/libstd/sys/common/libunwind.rs @@ -106,9 +106,15 @@ pub type _Unwind_Exception_Cleanup_Fn = #[cfg_attr(any(all(target_os = "linux", not(target_env = "musl")), target_os = "freebsd", target_os = "solaris", - all(target_os = "linux", target_env = "musl", not(target_arch = "x86_64"))), + all(target_os = "linux", + target_env = "musl", + not(target_arch = "x86"), + not(target_arch = "x86_64"))), link(name = "gcc_s"))] -#[cfg_attr(all(target_os = "linux", target_env = "musl", target_arch = "x86_64", not(test)), +#[cfg_attr(all(target_os = "linux", + target_env = "musl", + any(target_arch = "x86", target_arch = "x86_64"), + not(test)), link(name = "unwind", kind = "static"))] #[cfg_attr(any(target_os = "android", target_os = "openbsd"), link(name = "gcc"))] -- cgit 1.4.1-3-g733a5