rust: fix musl build

[ci skip]
This commit is contained in:
Rasmus Thomsen 2018-10-08 17:50:52 +02:00 committed by Enno Boland
parent a455f9876e
commit 0fbec0846e
3 changed files with 12 additions and 16 deletions

View file

@ -1,11 +0,0 @@
--- rustc-1.28.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs.orig 2018-08-08 23:21:51.673454236 +0200
+++ rustc-1.28.0-src/src/librustc_target/spec/x86_64_unknown_linux_musl.rs 2018-08-08 23:23:11.080834122 +0200
@@ -11,7 +11,7 @@
use spec::{LinkerFlavor, Target, TargetResult};
pub fn target() -> TargetResult {
- let mut base = super::linux_musl_base::opts();
+ let mut base = super::linux_base::opts();
base.cpu = "x86-64".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.get_mut(&LinkerFlavor::Gcc).unwrap().push("-m64".to_string());

View file

@ -0,0 +1,11 @@
Reason: https://gist.github.com/ab75b3796a9383423deecc0828494ac5
--- rustc-1.28.0-src/src/librustc_target/spec/linux_musl_base.rs.orig 2018-10-08 21:02:21.588611506 +0200
+++ rustc-1.28.0-src/src/librustc_target/spec/linux_musl_base.rs 2018-10-08 21:02:40.846454873 +0200
@@ -61,7 +61,7 @@
base.post_link_objects_crt.push("crtn.o".to_string());
// These targets statically link libc by default
- base.crt_static_default = true;
+ base.crt_static_default = false;
// These targets allow the user to choose between static and dynamic linking.
base.crt_static_respected = true;

View file

@ -89,10 +89,6 @@ esac
post_extract() {
rm -rf src/llvm
case "$XBPS_MACHINE" in
*-musl) patch -p1 < $FILESDIR/musl.patch ;;
esac
if [ -z "$CROSS_BUILD" ]; then
mkdir -p stage0
cp -bflr ../rustc-*/rustc/* stage0
@ -155,7 +151,7 @@ do_configure() {
fi
case "$XBPS_TARGET_MACHINE" in
*-musl)
configure_args+=" --musl-root=/usr"
configure_args+=" --set=target.${_host_triplet}.musl-root=/usr"
;;
esac