commit: 29a0c9c1b2c2b9698b1680bbfccc63150471e641 Author: Matt Jolly <kangie <AT> gentoo <DOT> org> AuthorDate: Thu Oct 2 06:33:35 2025 +0000 Commit: Matt Jolly <kangie <AT> gentoo <DOT> org> CommitDate: Thu Oct 2 06:33:35 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=29a0c9c1
Update compiler: musl: dynamic linking by default for 1.90.0 Signed-off-by: Matt Jolly <kangie <AT> gentoo.org> 1.90.0-compiler-musl-dynamic-linking.patch | 135 ++++------------------------- 1 file changed, 18 insertions(+), 117 deletions(-) diff --git a/1.90.0-compiler-musl-dynamic-linking.patch b/1.90.0-compiler-musl-dynamic-linking.patch index 0f0c4a7..ca69a59 100644 --- a/1.90.0-compiler-musl-dynamic-linking.patch +++ b/1.90.0-compiler-musl-dynamic-linking.patch @@ -1,8 +1,11 @@ -From 0c368b56fdc88719ff2bcf78746b618db8432a42 Mon Sep 17 00:00:00 2001 +From 5ff93d7c3144672785f894d6888f053329147fbb Mon Sep 17 00:00:00 2001 From: Matt Jolly <[email protected]> -Date: Tue, 29 Jul 2025 14:54:14 +1000 +Date: Thu, 2 Oct 2025 16:31:00 +1000 Subject: [PATCH] compiler: musl: dynamic linking by default +Recent upstream work (1.90.0) has enabled dynamic linking for all tier 3 +musl targets, but we want it everywhere. + Signed-off-by: Matt Jolly <[email protected]> --- .../src/spec/targets/aarch64_unknown_linux_musl.rs | 3 --- @@ -13,20 +16,13 @@ Signed-off-by: Matt Jolly <[email protected]> .../src/spec/targets/armv7_unknown_linux_musleabihf.rs | 3 +-- .../rustc_target/src/spec/targets/i586_unknown_linux_musl.rs | 2 -- .../rustc_target/src/spec/targets/i686_unknown_linux_musl.rs | 2 -- - .../src/spec/targets/mips64_unknown_linux_muslabi64.rs | 3 +-- .../src/spec/targets/mips64el_unknown_linux_muslabi64.rs | 3 +-- - .../src/spec/targets/powerpc64_unknown_linux_musl.rs | 3 +-- .../src/spec/targets/powerpc64le_unknown_linux_musl.rs | 3 +-- - .../src/spec/targets/powerpc_unknown_linux_musl.rs | 2 -- - .../src/spec/targets/powerpc_unknown_linux_muslspe.rs | 2 -- - .../src/spec/targets/riscv32gc_unknown_linux_musl.rs | 3 +-- - .../rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs | 2 -- - .../src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs | 3 +-- .../rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs | 2 -- - 18 files changed, 11 insertions(+), 37 deletions(-) + 11 files changed, 7 insertions(+), 23 deletions(-) diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs -index 478726fbef6..b7b345e568b 100644 +index 478726fbe..b7b345e56 100644 --- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs @@ -14,9 +14,6 @@ pub(crate) fn target() -> Target { @@ -40,7 +36,7 @@ index 478726fbef6..b7b345e568b 100644 llvm_target: "aarch64-unknown-linux-musl".into(), metadata: TargetMetadata { diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs -index 3919a5e0771..b623f9aef5d 100644 +index 3919a5e07..b623f9aef 100644 --- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs +++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs @@ -20,8 +20,7 @@ pub(crate) fn target() -> Target { @@ -54,7 +50,7 @@ index 3919a5e0771..b623f9aef5d 100644 }, } diff --git a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs -index ca52e5b3ca6..885bcb6dd8c 100644 +index ca52e5b3c..885bcb6dd 100644 --- a/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs +++ b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs @@ -20,8 +20,7 @@ pub(crate) fn target() -> Target { @@ -68,7 +64,7 @@ index ca52e5b3ca6..885bcb6dd8c 100644 }, } diff --git a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs -index e675739629b..4287b0f2611 100644 +index e67573962..4287b0f26 100644 --- a/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs +++ b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs @@ -20,8 +20,7 @@ pub(crate) fn target() -> Target { @@ -82,7 +78,7 @@ index e675739629b..4287b0f2611 100644 }, } diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs -index 42fbf6f4861..d9483fd163b 100644 +index 42fbf6f48..d9483fd16 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs @@ -24,8 +24,7 @@ pub(crate) fn target() -> Target { @@ -96,7 +92,7 @@ index 42fbf6f4861..d9483fd163b 100644 }, } diff --git a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs -index a3ac0223c84..5ac902bf350 100644 +index a3ac0223c..5ac902bf3 100644 --- a/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs +++ b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs @@ -23,8 +23,7 @@ pub(crate) fn target() -> Target { @@ -110,7 +106,7 @@ index a3ac0223c84..5ac902bf350 100644 }, } diff --git a/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs -index 42babb90da7..87628fcad4c 100644 +index 42babb90d..87628fcad 100644 --- a/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs @@ -5,7 +5,5 @@ pub(crate) fn target() -> Target { @@ -122,7 +118,7 @@ index 42babb90da7..87628fcad4c 100644 base } diff --git a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs -index 47a7eb3d597..da1026485bd 100644 +index 47a7eb3d5..da1026485 100644 --- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs @@ -11,8 +11,6 @@ pub(crate) fn target() -> Target { @@ -134,22 +130,8 @@ index 47a7eb3d597..da1026485bd 100644 // The unwinder used by i686-unknown-linux-musl, the LLVM libunwind // implementation, apparently relies on frame pointers existing... somehow. -diff --git a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs -index f95ce756354..b85df7f3a29 100644 ---- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs -+++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs -@@ -23,8 +23,7 @@ pub(crate) fn target() -> Target { - abi: "abi64".into(), - endian: Endian::Big, - mcount: "_mcount".into(), -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- crt_static_default: true, -+ crt_static_default: false, - llvm_abiname: "n64".into(), - ..base - }, diff --git a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs -index d42e097b0fd..328c8a3cc36 100644 +index d42e097b0..328c8a3cc 100644 --- a/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs +++ b/compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs @@ -5,8 +5,7 @@ pub(crate) fn target() -> Target { @@ -162,22 +144,8 @@ index d42e097b0fd..328c8a3cc36 100644 Target { // LLVM doesn't recognize "muslabi64" yet. llvm_target: "mips64el-unknown-linux-musl".into(), -diff --git a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs -index 4dc76f0936c..5fde7929062 100644 ---- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs -+++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs -@@ -10,8 +10,7 @@ pub(crate) fn target() -> Target { - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]); - base.max_atomic_width = Some(64); - base.stack_probes = StackProbeType::Inline; -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- base.crt_static_default = true; -+ base.crt_static_default = false; - base.abi = "elfv2".into(); - base.llvm_abiname = "elfv2".into(); - diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs -index 26ee6a68c6a..6fc67dfdcb6 100644 +index 26ee6a68c..6fc67dfdc 100644 --- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs @@ -8,8 +8,7 @@ pub(crate) fn target() -> Target { @@ -190,75 +158,8 @@ index 26ee6a68c6a..6fc67dfdcb6 100644 base.abi = "elfv2".into(); base.llvm_abiname = "elfv2".into(); -diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs -index 316b62d941b..f39142d0101 100644 ---- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs -+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs -@@ -9,8 +9,6 @@ pub(crate) fn target() -> Target { - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32"]); - base.max_atomic_width = Some(32); - base.stack_probes = StackProbeType::Inline; -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- base.crt_static_default = true; - - Target { - llvm_target: "powerpc-unknown-linux-musl".into(), -diff --git a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs -index 30d0d9cb60a..8ddb45483b3 100644 ---- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs -+++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs -@@ -9,8 +9,6 @@ pub(crate) fn target() -> Target { - base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-mspe"]); - base.max_atomic_width = Some(32); - base.stack_probes = StackProbeType::Inline; -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- base.crt_static_default = true; - - Target { - llvm_target: "powerpc-unknown-linux-muslspe".into(), -diff --git a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs -index 938b39b10c6..43a937c1a39 100644 ---- a/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs -+++ b/compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs -@@ -23,8 +23,7 @@ pub(crate) fn target() -> Target { - llvm_abiname: "ilp32d".into(), - max_atomic_width: Some(32), - supported_split_debuginfo: Cow::Borrowed(&[SplitDebuginfo::Off]), -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- crt_static_default: true, -+ crt_static_default: false, - ..base::linux_musl::opts() - }, - } -diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs -index e9522ac760e..0cdbb626739 100644 ---- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs -+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs -@@ -13,8 +13,6 @@ pub(crate) fn target() -> Target { - base.stack_probes = StackProbeType::Inline; - base.supported_sanitizers = - SanitizerSet::ADDRESS | SanitizerSet::LEAK | SanitizerSet::MEMORY | SanitizerSet::THREAD; -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- base.crt_static_default = true; - - Target { - llvm_target: "s390x-unknown-linux-musl".into(), -diff --git a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs -index 81c502bfead..fd1ebb430da 100644 ---- a/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs -+++ b/compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs -@@ -27,8 +27,7 @@ pub(crate) fn target() -> Target { - features: "+v7,+thumb-mode,+thumb2,+vfp3,+neon".into(), - max_atomic_width: Some(64), - mcount: "\u{1}mcount".into(), -- // FIXME(compiler-team#422): musl targets should be dynamically linked by default. -- crt_static_default: true, -+ crt_static_default: false, - ..base::linux_musl::opts() - }, - } diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs -index cc5f8886240..0203c776a01 100644 +index cc5f88862..0203c776a 100644 --- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs +++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs @@ -16,8 +16,6 @@ pub(crate) fn target() -> Target { @@ -271,5 +172,5 @@ index cc5f8886240..0203c776a01 100644 Target { llvm_target: "x86_64-unknown-linux-musl".into(), -- -2.50.1 +2.51.0
