aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory Pratt <anarchy@gentoo.org>2021-12-01 16:46:24 -0600
committerJory Pratt <anarchy@gentoo.org>2021-12-01 16:46:24 -0600
commitf3308830d09fb15b6345ebffc7c8874a49106994 (patch)
tree1f31469bb6c0bb937418e702312721723290ec39 /dev-lang/rust/files
parentapp-office/libreoffice: bump for stable amd64 users (diff)
downloadmusl-f3308830d09fb15b6345ebffc7c8874a49106994.tar.gz
musl-f3308830d09fb15b6345ebffc7c8874a49106994.tar.bz2
musl-f3308830d09fb15b6345ebffc7c8874a49106994.zip
dev-lang/rust: use dynamic linking for arm64/amd64 musl builds
Package-Manager: Portage-3.0.28, Repoman-3.0.3 Signed-off-by: Jory Pratt <anarchy@gentoo.org>
Diffstat (limited to 'dev-lang/rust/files')
-rw-r--r--dev-lang/rust/files/1.55.0-ignore-broken-and-non-applicable-tests.patch76
-rw-r--r--dev-lang/rust/files/1.56.1-musl-dynamic-linking.patch69
2 files changed, 145 insertions, 0 deletions
diff --git a/dev-lang/rust/files/1.55.0-ignore-broken-and-non-applicable-tests.patch b/dev-lang/rust/files/1.55.0-ignore-broken-and-non-applicable-tests.patch
new file mode 100644
index 00000000..c3bee9ba
--- /dev/null
+++ b/dev-lang/rust/files/1.55.0-ignore-broken-and-non-applicable-tests.patch
@@ -0,0 +1,76 @@
+From 1879d1d1a284bf51c752e47db284ce22701ed5d0 Mon Sep 17 00:00:00 2001
+From: Samuel Holland <samuel@sholland.org>
+Date: Sun, 16 Sep 2018 16:38:48 +0000
+Subject: [PATCH 12/15] Ignore broken and non-applicable tests
+
+c-link-to-rust-va-list-fn: unstable feature, broken on aarch64, #56475
+env-funky-keys: can't handle LD_PRELOAD (e.g. sandbox)
+long-linker-command-lines: takes >10 minutes to run (but still passes)
+simd-intrinsic-generic-bitmask.rs: broken on BE, #59356
+sparc-struct-abi: no sparc target
+sysroot-crates-are-unstable: can't run rustc without RPATH
+---
+ src/test/codegen/sparc-struct-abi.rs | 1 +
+ src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile | 2 ++
+ src/test/run-make-fulldeps/long-linker-command-lines/Makefile | 2 ++
+ src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile | 2 ++
+ src/test/ui/env-funky-keys.rs | 1 +
+ 6 files changed, 10 insertions(+)
+
+diff --git a/src/test/codegen/sparc-struct-abi.rs b/src/test/codegen/sparc-struct-abi.rs
+index 78e5b14a212..6f93e93286b 100644
+--- a/src/test/codegen/sparc-struct-abi.rs
++++ b/src/test/codegen/sparc-struct-abi.rs
+@@ -2,6 +2,7 @@
+
+ // only-sparc64
+ // compile-flags: -O --target=sparc64-unknown-linux-gnu --crate-type=rlib
+ // needs-llvm-components: sparc
++// ignore-test
+ #![feature(no_core, lang_items)]
+ #![no_core]
+
+diff --git a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+index f124ca2ab61..363b18f0985 100644
+--- a/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
++++ b/src/test/run-make-fulldeps/c-link-to-rust-va-list-fn/Makefile
+@@ -1,3 +1,5 @@
++# ignore-aarch64
++
+ -include ../tools.mk
+
+ all:
+diff --git a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
+index 5876fbc94bc..5f167ece1a2 100644
+--- a/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
++++ b/src/test/run-make-fulldeps/long-linker-command-lines/Makefile
+@@ -1,3 +1,5 @@
++# ignore-test
++
+ -include ../tools.mk
+
+ all:
+diff --git a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+index 9e770706857..6d92ec5cec8 100644
+--- a/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
++++ b/src/test/run-make-fulldeps/sysroot-crates-are-unstable/Makefile
+@@ -1,1 +1,3 @@
++# ignore-test
++
+ all:
+ python2.7 test.py
+diff --git a/src/test/ui/env-funky-keys.rs b/src/test/ui/env-funky-keys.rs
+index c5c824ac58d..f3fe047a79c 100644
+--- a/src/test/ui/env-funky-keys.rs
++++ b/src/test/ui/env-funky-keys.rs
+@@ -1,6 +1,7 @@
+ // run-pass
+ // Ignore this test on Android, because it segfaults there.
+
++// ignore-test
+ // ignore-android
+ // ignore-windows
+ // ignore-cloudabi no execve
+--
+2.24.1
+
diff --git a/dev-lang/rust/files/1.56.1-musl-dynamic-linking.patch b/dev-lang/rust/files/1.56.1-musl-dynamic-linking.patch
new file mode 100644
index 00000000..b556228c
--- /dev/null
+++ b/dev-lang/rust/files/1.56.1-musl-dynamic-linking.patch
@@ -0,0 +1,69 @@
+From f11729adb9990528a38df7c703bf589d58998c4f Mon Sep 17 00:00:00 2001
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Wed, 24 Nov 2021 21:32:50 -0600
+Subject: [PATCH] [PATCH] Fix linux_musl_base for native musl host
+
+See https://github.com/rust-lang/rust/pull/40113
+---
+ compiler/rustc_target/src/spec/crt_objects.rs | 22 -------------------
+ .../rustc_target/src/spec/linux_musl_base.rs | 6 +----
+ 2 files changed, 1 insertion(+), 27 deletions(-)
+
+diff --git a/compiler/rustc_target/src/spec/crt_objects.rs b/compiler/rustc_target/src/spec/crt_objects.rs
+index 2fc9ab29f..276736159 100644
+--- a/compiler/rustc_target/src/spec/crt_objects.rs
++++ b/compiler/rustc_target/src/spec/crt_objects.rs
+@@ -62,28 +62,6 @@ pub(super) fn all(obj: &str) -> CrtObjects {
+ ])
+ }
+
+-pub(super) fn pre_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::DynamicPicExe, &["Scrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crt1.o", "crti.o", "crtbegin.o"]),
+- (LinkOutputKind::StaticPicExe, &["rcrt1.o", "crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::DynamicDylib, &["crti.o", "crtbeginS.o"]),
+- (LinkOutputKind::StaticDylib, &["crti.o", "crtbeginS.o"]),
+- ])
+-}
+-
+-pub(super) fn post_musl_fallback() -> CrtObjects {
+- new(&[
+- (LinkOutputKind::DynamicNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::DynamicPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticNoPicExe, &["crtend.o", "crtn.o"]),
+- (LinkOutputKind::StaticPicExe, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::DynamicDylib, &["crtendS.o", "crtn.o"]),
+- (LinkOutputKind::StaticDylib, &["crtendS.o", "crtn.o"]),
+- ])
+-}
+-
+ pub(super) fn pre_mingw_fallback() -> CrtObjects {
+ new(&[
+ (LinkOutputKind::DynamicNoPicExe, &["crt2.o", "rsbegin.o"]),
+diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
+index 5038a967d..25d634a1e 100644
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -1,16 +1,12 @@
+-use crate::spec::crt_objects::{self, CrtObjectsFallback};
+ use crate::spec::TargetOptions;
+
+ pub fn opts() -> TargetOptions {
+ let mut base = super::linux_base::opts();
+
+ base.env = "musl".to_string();
+- base.pre_link_objects_fallback = crt_objects::pre_musl_fallback();
+- base.post_link_objects_fallback = crt_objects::post_musl_fallback();
+- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
+
+ // These targets statically link libc by default
+- base.crt_static_default = true;
++ base.crt_static_default = false;
+
+ base
+ }
+--
+2.32.0
+