aboutsummaryrefslogtreecommitdiffstats
path: root/testing/rust
diff options
context:
space:
mode:
authorShiz <hi@shiz.me>2017-04-12 19:52:52 +0000
committerJakub Jirutka <jakub@jirutka.cz>2017-04-13 00:29:51 +0200
commit0c9c5f8c93e636078d89eb27abc68b45306a16ce (patch)
tree6264663b5fee47bed4769ca5f4ca9adfb0061518 /testing/rust
parenteab991f2cbf1d3f174880c28bfd7efd6b8e87ee0 (diff)
downloadaports-0c9c5f8c93e636078d89eb27abc68b45306a16ce.tar.bz2
aports-0c9c5f8c93e636078d89eb27abc68b45306a16ce.tar.xz
testing/rust: link libunwind properly and clean up libc link patch
Diffstat (limited to 'testing/rust')
-rw-r--r--testing/rust/APKBUILD9
-rw-r--r--testing/rust/remove-crt-static-from-stdlibs.patch23
-rw-r--r--testing/rust/support-dynamically-linked-musl.patch57
3 files changed, 21 insertions, 68 deletions
diff --git a/testing/rust/APKBUILD b/testing/rust/APKBUILD
index 8b9404966f..3391da5364 100644
--- a/testing/rust/APKBUILD
+++ b/testing/rust/APKBUILD
@@ -6,7 +6,7 @@ pkgver=1.16.0
# Git revision of prebuilt Cargo to use for bootstrapping, from src/stage0.txt.
_cargo_gitrev=6e0c18cccc8b0c06fba8a8d76486f81a792fb420
_llvmver=3.9
-pkgrel=1
+pkgrel=2
pkgdesc="The Rust Programming Language (compiler)"
url="http://www.rust-lang.org"
arch="x86_64"
@@ -16,8 +16,7 @@ license="ASL-2.0 BSD ISC MIT"
# See: https://github.com/rust-lang/rust/issues/11937
depends="$pkgname-stdlib=$pkgver-r$pkgrel gcc llvm-libunwind-dev musl-dev"
# libffi-dev is needed just because we compile llvm with LLVM_ENABLE_FFI.
-makedepends="cmake file libffi-dev llvm-libunwind-dev llvm$_llvmver-dev
- musl-dev python2 tar zlib-dev"
+makedepends="cmake file libffi-dev llvm$_llvmver-dev python2 tar zlib-dev"
subpackages="$pkgname-dbg $pkgname-stdlib
$pkgname-gdb::noarch $pkgname-lldb::noarch $pkgname-doc"
@@ -31,7 +30,6 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
cargo-$_cargo_gitrev-x86_64-unknown-linux-musl.tar.gz::https://s3.amazonaws.com/rust-lang-ci/cargo-builds/$_cargo_gitrev/cargo-nightly-x86_64-unknown-linux-musl.tar.gz
dont-require-filecheck.patch
support-dynamically-linked-musl.patch
- remove-crt-static-from-stdlibs.patch
allow-crt-static-on-stable.patch
static-pie.patch
fix-linux_musl_base.patch
@@ -185,8 +183,7 @@ e9b10d58ae5b51b09dd31a1dbf7367917bd40a05ecb4ba3e0e7ac229a0352d3ceb77de80f7c0120f
54467213b2824112dec6d5a132ab01d69617a5ccaa9db15e5c8fad55dea5eb31b1b7c9ca07878901d75edd45dc84c726913bf651f3435c480a79703c074b5d90 rust-std-1.16.0-x86_64-unknown-linux-musl.tar.gz
4df33353b6be1af822220ca03f9ec5a3b6421c9b10ec17b864be586ba495c6210bac70d904b0e0b35eff62ef2c9a681ded526e5cbd37e326dc3146742aa659de cargo-6e0c18cccc8b0c06fba8a8d76486f81a792fb420-x86_64-unknown-linux-musl.tar.gz
2002faf08cca3be702f25618bc17453c5e76644a6ff6b0739b642c2c0f8536ec7f09c98182aff6b2dcc87c77b0929f2f8f732b8242a8f80d94b3824c8cd0d0fe dont-require-filecheck.patch
-a87ffe129debcb9fa958c6d007ffa4a87927890030e0694ee5ab1929ea0c5a48dad86b4e8b71550dcfeda29b644dbb23d8b232bda62439f198a404cf658c68b0 support-dynamically-linked-musl.patch
-027d9ddf70d48324b8d88760c0a9311c985139bf3309c21eb65d03ab776ddf2d557cf8dd90964a4f6a072e67dd88a335b1bc98ccb9211e00a208b3ef80a15bc0 remove-crt-static-from-stdlibs.patch
+b0a8883e4469b60edd150c84486ab950396d757220f97bd271529576614c6c3b49456098507503832c20619d4bd74246dbc99c78116634a68a6df994793e9a94 support-dynamically-linked-musl.patch
67f5933fd2da8f2b5eb0d62e05af52d161bd0602fe9353adc9a2128b9c9ba42578587d4963357a483638af3e5f74cef69a994c45ea20ce6c22f6016e5bcc3125 allow-crt-static-on-stable.patch
79d7eb79bb5219beab2fa8394e30b830275ce3062fd7c02077229ad1fdca492f55d321e0bc1015f62252fe4df3cc41c5168ff9d2e848ae06b14f807add7e193a static-pie.patch
f436fddf7ab70ca5f1424081f5b75450270b200b3d997231323863e11addf76e1d65831a7ca09e3a5b7904ce828766c1f70b08326a175890298f28e5bc8646ef fix-linux_musl_base.patch
diff --git a/testing/rust/remove-crt-static-from-stdlibs.patch b/testing/rust/remove-crt-static-from-stdlibs.patch
deleted file mode 100644
index d27a0f74c1..0000000000
--- a/testing/rust/remove-crt-static-from-stdlibs.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- a/src/liblibc/src/unix/mod.rs
-+++ b/src/liblibc/src/unix/mod.rs
-@@ -210,8 +210,7 @@ cfg_if! {
- // cargo build, don't pull in anything extra as the libstd dep
- // already pulls in all libs.
-- } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
-+ } else if #[cfg(target_env = "musl")] {
-- #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
-- #[link(name = "c", cfg(not(target_feature = "crt-static")))]
-+ #[link(name = "c")]
- extern {}
- } else if #[cfg(target_os = "emscripten")] {
- #[link(name = "c")]
---- a/src/libunwind/lib.rs
-+++ b/src/libunwind/lib.rs
-@@ -30,6 +30,5 @@
- 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")))]
-+#[link(name = "unwind")]
- extern {}
diff --git a/testing/rust/support-dynamically-linked-musl.patch b/testing/rust/support-dynamically-linked-musl.patch
index 69834602cd..7c4e93681b 100644
--- a/testing/rust/support-dynamically-linked-musl.patch
+++ b/testing/rust/support-dynamically-linked-musl.patch
@@ -1,6 +1,7 @@
From 3abd1f5e2f31b1c95535ef8c3b4bef6ff78b3fa9 Mon Sep 17 00:00:00 2001
From: Samuel Holland <samuel@sholland.org>
-Date: Sat, 25 Feb 2017 22:30:15 -0600
+From: Shiz <hi@shiz.me>
+Date: Wed, 12 Apr 2017 22:31:06 +0200
Subject: [PATCH] Support dynamically-linked and/or native musl targets
These changes allow native compilation on musl-based distributions and the
@@ -9,22 +10,7 @@ limitations based on past assumptions about musl targets, while
maintaining existing behavior by default.
Upstream-Issue: https://github.com/rust-lang/rust/pull/40113
----
- src/bootstrap/bin/rustc.rs | 11 ++++++++
- src/bootstrap/compile.rs | 7 ++++--
- src/bootstrap/config.rs | 3 +++
- src/bootstrap/lib.rs | 14 +++++++++++
- src/bootstrap/sanity.rs | 11 ++++++--
- src/librustc/session/mod.rs | 29 ++++++++++++++++++++++
- src/librustc_back/target/linux_musl_base.rs | 9 +------
- .../target/mips_unknown_linux_musl.rs | 1 +
- .../target/mipsel_unknown_linux_musl.rs | 1 +
- src/librustc_driver/target_features.rs | 27 +-------------------
- src/librustc_trans/back/link.rs | 22 +++++++++-------
- src/libstd/build.rs | 2 +-
- src/libunwind/build.rs | 4 +--
- src/libunwind/lib.rs | 6 +++++
- 14 files changed, 97 insertions(+), 50 deletions(-)
+See-Also: https://internals.rust-lang.org/t/refining-cross-platform-crt-static-semantics/5085
diff --git a/src/bootstrap/bin/rustc.rs b/src/bootstrap/bin/rustc.rs
index 90fd31ecbd..28520a2c60 100644
@@ -354,31 +340,24 @@ index db41a368a1..b1a86f04ef 100644
- if target.contains("musl") && !target.contains("mips") {
- println!("cargo:rustc-link-lib=static=unwind");
+ if target.contains("musl") {
-+ // musl is handled in lib.rs
++ println!("cargo:rustc-link-lib=unwind");
} else if !target.contains("android") {
println!("cargo:rustc-link-lib=gcc_s");
}
-diff --git a/src/libunwind/lib.rs b/src/libunwind/lib.rs
-index 7fa2ce650f..b78e762f45 100644
---- a/src/libunwind/lib.rs
-+++ b/src/libunwind/lib.rs
-@@ -15,6 +15,7 @@
- #![deny(warnings)]
-
- #![feature(cfg_target_vendor)]
-+#![feature(link_cfg)]
- #![feature(staged_api)]
- #![feature(unwind_attributes)]
-
-@@ -27,3 +28,8 @@ extern crate libc;
- mod libunwind;
- #[cfg(not(target_env = "msvc"))]
- 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 {}
+diff --git a/src/liblibc/src/unix/mod.rs b/src/liblibc/src/unix/mod.rs
+--- a/src/liblibc/src/unix/mod.rs
++++ b/src/liblibc/src/unix/mod.rs
+@@ -210,8 +210,7 @@ cfg_if! {
+ // cargo build, don't pull in anything extra as the libstd dep
+ // already pulls in all libs.
+- } else if #[cfg(any(all(target_env = "musl", not(target_arch = "mips"))))] {
++ } else if #[cfg(target_env = "musl")] {
+- #[link(name = "c", kind = "static", cfg(target_feature = "crt-static"))]
+- #[link(name = "c", cfg(not(target_feature = "crt-static")))]
++ #[link(name = "c")]
+ extern {}
+ } else if #[cfg(target_os = "emscripten")] {
+ #[link(name = "c")]
--
2.12.2