Skip to content

Commit

Permalink
rust: fix musl build
Browse files Browse the repository at this point in the history
[ci skip]
  • Loading branch information
Rasmus Thomsen authored and Gottox committed Oct 9, 2018
1 parent a455f98 commit 0fbec08
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 16 deletions.
11 changes: 0 additions & 11 deletions srcpkgs/rust/files/musl.patch

This file was deleted.

11 changes: 11 additions & 0 deletions srcpkgs/rust/patches/musl-dont-use-crt-static.patch
Original file line number Diff line number Diff line change
@@ -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;
6 changes: 1 addition & 5 deletions srcpkgs/rust/template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 0fbec08

Please sign in to comment.