* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 7cf432eff81656ac286c1ff3e4d549f35c22c784
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:16 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:16 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=7cf432ef
Initial commit with README
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
README.rst | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..9999e72
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,24 @@
+###################
+Gentoo Rust Patches
+###################
+
+This repository contains patches required to build Rust on Gentoo Linux. These patches were previously
+part of the main Gentoo repository but have been moved here due to their size and to make maintenance easier.
+
+The patches are applied to the Rust source code during the build process. They address various issues such as
+compatibility with the Gentoo environment, specific compiler flags, and other adjustments needed for a successful build,
+or are backports to fix specific issues.
+
+Usage
+=====
+
+A branch will be created for each new Rust release (e.g. ``1.88``), and patches will be added to that branch as needed.
+
+Tags for ``${PV}`` will be created for each release, e.g. ``1.88.0``, ``1.88.1``, etc., to track the specific versions of
+Rust that these patches apply to. Revbumps will be tagged as required - if a patch is added or updated, a tag will be
+created for the new version (e.g. ``1.88.0-r1``).
+
+``master`` will contain patches required for ``nightly`` (live / ``9999``) ebuilds and will be updated as needed.
+
+To use the patches, you can clone this repository and apply the patches to the Rust source code before building
+(or use the Gentoo ebuild system which will handle this automatically!).
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: f07a431a8b9d053d536b71a137f85621583d131b
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:16 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:16 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=f07a431a
Add patches for Rust 1.75.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 39 ++++++++++++++++++++++
...king.patch => 1.75.0-musl-dynamic-linking.patch | 4 +--
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
new file mode 100644
index 0000000..5d39022
--- /dev/null
+++ b/1.75.0-handle-vendored-sources.patch
@@ -0,0 +1,39 @@
+From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
+From: Arlo Siemsen <arsiem@microsoft.com>
+Date: Thu, 4 Jan 2024 11:40:56 -0600
+Subject: [PATCH] Handle vendored sources when remapping paths
+
+Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
+--- a/src/bootstrap/src/core/builder.rs
++++ b/src/bootstrap/src/core/builder.rs
+@@ -1799,15 +1799,20 @@ pub fn cargo(
+ }
+
+ if self.config.rust_remap_debuginfo {
+- // FIXME: handle vendored sources
+- let registry_src = t!(home::cargo_home()).join("registry").join("src");
+ let mut env_var = OsString::new();
+- for entry in t!(std::fs::read_dir(registry_src)) {
+- if !env_var.is_empty() {
+- env_var.push("\t");
+- }
+- env_var.push(t!(entry).path());
++ if self.config.vendor {
++ let vendor = self.build.src.join("vendor");
++ env_var.push(vendor);
+ env_var.push("=/rust/deps");
++ } else {
++ let registry_src = t!(home::cargo_home()).join("registry").join("src");
++ for entry in t!(std::fs::read_dir(registry_src)) {
++ if !env_var.is_empty() {
++ env_var.push("\t");
++ }
++ env_var.push(t!(entry).path());
++ env_var.push("=/rust/deps");
++ }
+ }
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
+ }
+--
+2.43.0
+
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.75.0-musl-dynamic-linking.patch
similarity index 82%
rename from 1.62.1-musl-dynamic-linking.patch
rename to 1.75.0-musl-dynamic-linking.patch
index b64775c..7dc34f8 100644
--- a/1.62.1-musl-dynamic-linking.patch
+++ b/1.75.0-musl-dynamic-linking.patch
@@ -4,8 +4,8 @@ Date: Tue, 2 Aug 2022 18:32:53 -0500
Subject: [PATCH] Enable dynamic linking by default for musl
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
++++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: e6afd1fe4bd15d46f748745ba16c6206b14a62c6
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:16 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:16 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=e6afd1fe
Add patches for Rust 1.76.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
new file mode 100644
index 0000000..02bfeca
--- /dev/null
+++ b/1.76.0-loong-code-model.patch
@@ -0,0 +1,73 @@
+https://github.com/rust-lang/rust/pull/120661
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Mon, 5 Feb 2024 13:18:32 +0800
+Subject: [PATCH] target: default to the medium code model on LoongArch targets
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Rust LoongArch targets have been using the default LLVM code model
+so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
+As described in the "Code Model" section of LoongArch ELF psABI spec
+v20231219 [1], one can only make function calls as far as ±128MiB with
+the "normal" code model; this is insufficient for very large software
+containing Rust components that needs to be linked into the big text
+section, such as Chromium.
+
+Because:
+
+* we do not want to ask users to recompile std if they are to build
+ such software,
+* objects compiled with larger code models can be linked with those
+ with smaller code models without problems, and
+* the "medium" code model is comparable to the "small"/"normal" one
+ performance-wise (same data access pattern; each function call
+ becomes 2-insn long and indirect, but this may be relaxed back into
+ the direct 1-insn form in a future LLVM version), but is able to
+ perform function calls within ±128GiB,
+
+it is better to just switch the targets to the "medium" code model,
+which is also "medium" in LLVM-speak.
+
+[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
+@@ -1,4 +1,4 @@
+-use crate::spec::{base, Target, TargetOptions};
++use crate::spec::{base, CodeModel, Target, TargetOptions};
+
+ pub fn target() -> Target {
+ Target {
+@@ -7,6 +7,7 @@ pub fn target() -> Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
+ arch: "loongarch64".into(),
+ options: TargetOptions {
++ code_model: Some(CodeModel::Medium),
+ cpu: "generic".into(),
+ features: "+f,+d".into(),
+ llvm_abiname: "lp64d".into(),
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+@@ -16,7 +16,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
+@@ -17,7 +17,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--
+2.43.0
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: b3d182e7b831e65530c51d81bf21ac654c5dd81d
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:16 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:16 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b3d182e7
Add patches for Rust 1.74.1-r101
Patches:
- 1.62.1-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.62.1-musl-dynamic-linking.patch | 19 +++++++++++++++
1.67.0-doc-wasm.patch | 28 ++++++++++++++++++++++
....0-ignore-broken-and-non-applicable-tests.patch | 24 +++++++++++++++++++
1.74.1-cross-compile-libz.patch | 17 +++++++++++++
4 files changed, 88 insertions(+)
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.62.1-musl-dynamic-linking.patch
new file mode 100644
index 0000000..b64775c
--- /dev/null
+++ b/1.62.1-musl-dynamic-linking.patch
@@ -0,0 +1,19 @@
+From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Tue, 2 Aug 2022 18:32:53 -0500
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
+ 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.35.1
diff --git a/1.67.0-doc-wasm.patch b/1.67.0-doc-wasm.patch
new file mode 100644
index 0000000..30cb8b9
--- /dev/null
+++ b/1.67.0-doc-wasm.patch
@@ -0,0 +1,28 @@
+From 92aa5f6b272bcdc020a34f8d90f9ef851b5b4504 Mon Sep 17 00:00:00 2001
+From: John Millikin <john@john-millikin.com>
+Date: Mon, 9 Jan 2023 13:54:21 +0900
+Subject: [PATCH] Disable `linux_ext` in wasm32 and fortanix rustdoc builds.
+
+The `std::os::unix` module is stubbed out when building docs for these
+target platforms. The introduction of Linux-specific extension traits
+caused `std::os::net` to depend on sub-modules of `std::os::unix`,
+which broke rustdoc for the `wasm32-unknown-unknown` target.
+
+Adding an additional `#[cfg]` guard solves that rustdoc failure by
+not declaring `linux_ext` on targets with a stubbed `std::os::unix`.
+--- a/library/std/src/os/net/mod.rs
++++ b/library/std/src/os/net/mod.rs
+@@ -1,4 +1,13 @@
+ //! OS-specific networking functionality.
+
++// See cfg macros in `library/std/src/os/mod.rs` for why these platforms must
++// be special-cased during rustdoc generation.
++#[cfg(not(all(
++ doc,
++ any(
++ all(target_arch = "wasm32", not(target_os = "wasi")),
++ all(target_vendor = "fortanix", target_env = "sgx")
++ )
++)))]
+ #[cfg(any(target_os = "linux", target_os = "android", doc))]
+ pub(super) mod linux_ext;
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.70.0-ignore-broken-and-non-applicable-tests.patch
new file mode 100644
index 0000000..590f960
--- /dev/null
+++ b/1.70.0-ignore-broken-and-non-applicable-tests.patch
@@ -0,0 +1,24 @@
+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
+--- a/tests/ui/env-funky-keys.rs
++++ b/tests/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/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
new file mode 100644
index 0000000..98cec09
--- /dev/null
+++ b/1.74.1-cross-compile-libz.patch
@@ -0,0 +1,17 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -237,10 +237,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+-
+- if !is_crossed {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ if (target.starts_with("arm") && !target.contains("freebsd"))
+ || target.starts_with("mips-")
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: f9d03694650bce7be03e99f95d860675a849f3ca
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=f9d03694
Add patches for Rust 1.80.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
....0-ignore-broken-and-non-applicable-tests.patch | 24 ----------------------
1 file changed, 24 deletions(-)
diff --git a/1.78.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
deleted file mode 100644
index 742c81a..0000000
--- a/1.78.0-ignore-broken-and-non-applicable-tests.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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
---- a/tests/ui/env-funky-keys.rs
-+++ b/tests/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
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 4b1ef8d3cb7847ac65739560591d9cd26af33e86
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:16 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:16 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=4b1ef8d3
Add patches for Rust 1.77.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 39 ------------------------------------
1 file changed, 39 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
deleted file mode 100644
index 5d39022..0000000
--- a/1.75.0-handle-vendored-sources.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
-From: Arlo Siemsen <arsiem@microsoft.com>
-Date: Thu, 4 Jan 2024 11:40:56 -0600
-Subject: [PATCH] Handle vendored sources when remapping paths
-
-Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---- a/src/bootstrap/src/core/builder.rs
-+++ b/src/bootstrap/src/core/builder.rs
-@@ -1799,15 +1799,20 @@ pub fn cargo(
- }
-
- if self.config.rust_remap_debuginfo {
-- // FIXME: handle vendored sources
-- let registry_src = t!(home::cargo_home()).join("registry").join("src");
- let mut env_var = OsString::new();
-- for entry in t!(std::fs::read_dir(registry_src)) {
-- if !env_var.is_empty() {
-- env_var.push("\t");
-- }
-- env_var.push(t!(entry).path());
-+ if self.config.vendor {
-+ let vendor = self.build.src.join("vendor");
-+ env_var.push(vendor);
- env_var.push("=/rust/deps");
-+ } else {
-+ let registry_src = t!(home::cargo_home()).join("registry").join("src");
-+ for entry in t!(std::fs::read_dir(registry_src)) {
-+ if !env_var.is_empty() {
-+ env_var.push("\t");
-+ }
-+ env_var.push(t!(entry).path());
-+ env_var.push("=/rust/deps");
-+ }
- }
- cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
- }
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 54b996aa8002f62ad89732c53055d95331380b3a
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=54b996aa
Add patches for Rust 1.78.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.78.0-ignore-broken-and-non-applicable-tests.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 ----------------------
....0-ignore-broken-and-non-applicable-tests.patch | 12 ++--
...king.patch => 1.78.0-musl-dynamic-linking.patch | 2 +-
1.79.0-revert-8c40426.patch | 16 +++++
4 files changed, 23 insertions(+), 80 deletions(-)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
deleted file mode 100644
index 02bfeca..0000000
--- a/1.76.0-loong-code-model.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-https://github.com/rust-lang/rust/pull/120661
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Mon, 5 Feb 2024 13:18:32 +0800
-Subject: [PATCH] target: default to the medium code model on LoongArch targets
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The Rust LoongArch targets have been using the default LLVM code model
-so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
-As described in the "Code Model" section of LoongArch ELF psABI spec
-v20231219 [1], one can only make function calls as far as ±128MiB with
-the "normal" code model; this is insufficient for very large software
-containing Rust components that needs to be linked into the big text
-section, such as Chromium.
-
-Because:
-
-* we do not want to ask users to recompile std if they are to build
- such software,
-* objects compiled with larger code models can be linked with those
- with smaller code models without problems, and
-* the "medium" code model is comparable to the "small"/"normal" one
- performance-wise (same data access pattern; each function call
- becomes 2-insn long and indirect, but this may be relaxed back into
- the direct 1-insn form in a future LLVM version), but is able to
- perform function calls within ±128GiB,
-
-it is better to just switch the targets to the "medium" code model,
-which is also "medium" in LLVM-speak.
-
-[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{base, Target, TargetOptions};
-+use crate::spec::{base, CodeModel, Target, TargetOptions};
-
- pub fn target() -> Target {
- Target {
-@@ -7,6 +7,7 @@ pub fn target() -> Target {
- data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
- arch: "loongarch64".into(),
- options: TargetOptions {
-+ code_model: Some(CodeModel::Medium),
- cpu: "generic".into(),
- features: "+f,+d".into(),
- llvm_abiname: "lp64d".into(),
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-@@ -16,7 +16,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-@@ -17,7 +17,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---
-2.43.0
-
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
similarity index 80%
rename from 1.70.0-ignore-broken-and-non-applicable-tests.patch
rename to 1.78.0-ignore-broken-and-non-applicable-tests.patch
index 590f960..742c81a 100644
--- a/1.70.0-ignore-broken-and-non-applicable-tests.patch
+++ b/1.78.0-ignore-broken-and-non-applicable-tests.patch
@@ -12,13 +12,13 @@ sysroot-crates-are-unstable: can't run rustc without RPATH
--- a/tests/ui/env-funky-keys.rs
+++ b/tests/ui/env-funky-keys.rs
@@ -1,6 +1,7 @@
- // run-pass
- // Ignore this test on Android, because it segfaults there.
+ //@ run-pass
+ //@ Ignore this test on Android, because it segfaults there.
-+// ignore-test
- // ignore-android
- // ignore-windows
- // ignore-cloudabi no execve
++//@ ignore-test
+ //@ ignore-android
+ //@ ignore-windows
+ //@ ignore-cloudabi no execve
--
2.24.1
diff --git a/1.75.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
similarity index 88%
rename from 1.75.0-musl-dynamic-linking.patch
rename to 1.78.0-musl-dynamic-linking.patch
index 7dc34f8..25a281c 100644
--- a/1.75.0-musl-dynamic-linking.patch
+++ b/1.78.0-musl-dynamic-linking.patch
@@ -7,7 +7,7 @@ Signed-off-by: Jory Pratt <anarchy@gentoo.org>
--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
+ base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
// These targets statically link libc by default
- base.crt_static_default = true;
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
new file mode 100644
index 0000000..3d1bb75
--- /dev/null
+++ b/1.79.0-revert-8c40426.patch
@@ -0,0 +1,16 @@
+This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
+
+https://bugs.gentoo.org/933382
+
+--- a/src/bootstrap/src/core/build_steps/llvm.rs
++++ b/src/bootstrap/src/core/build_steps/llvm.rs
+@@ -724,8 +724,7 @@ fn configure_cmake(
+ }
+ }
+ cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
+- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
+- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
++ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
+ }
+
+ cfg.build_arg("-j").build_arg(builder.jobs().to_string());
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: ad0c8b81b83660581f8f8c427aff2cd6b32d7865
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=ad0c8b81
Add patches for Rust 1.83.0-r3
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.83.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.74.1-cross-compile-libz.patch | 17 -----------------
1.83.0-cross-compile-libz.patch | 19 +++++++++++++++++++
...sertion.patch => 1.83.0-dwarf-llvm-assertion.patch | 7 +------
3 files changed, 20 insertions(+), 23 deletions(-)
diff --git a/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
deleted file mode 100644
index 98cec09..0000000
--- a/1.74.1-cross-compile-libz.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
-
---- a/compiler/rustc_llvm/build.rs
-+++ b/compiler/rustc_llvm/build.rs
-@@ -237,10 +237,7 @@ fn main() {
- // of llvm-config, not the target that we're attempting to link.
- let mut cmd = Command::new(&llvm_config);
- cmd.arg(llvm_link_arg).arg("--libs");
--
-- if !is_crossed {
-- cmd.arg("--system-libs");
-- }
-+ cmd.arg("--system-libs");
-
- if (target.starts_with("arm") && !target.contains("freebsd"))
- || target.starts_with("mips-")
diff --git a/1.83.0-cross-compile-libz.patch b/1.83.0-cross-compile-libz.patch
new file mode 100644
index 0000000..1eac04b
--- /dev/null
+++ b/1.83.0-cross-compile-libz.patch
@@ -0,0 +1,19 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -220,12 +220,7 @@
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+
+- // Don't link system libs if cross-compiling unless targetting Windows.
+- // On Windows system DLLs aren't linked directly, instead import libraries are used.
+- // These import libraries are independent of the host.
+- if !is_crossed || target.contains("windows") {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ // We need libkstat for getHostCPUName on SPARC builds.
+ // See also: https://github.com/llvm/llvm-project/issues/64186
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
similarity index 98%
rename from 1.82.0-dwarf-llvm-assertion.patch
rename to 1.83.0-dwarf-llvm-assertion.patch
index b23ae2f..96bdac0 100644
--- a/1.82.0-dwarf-llvm-assertion.patch
+++ b/1.83.0-dwarf-llvm-assertion.patch
@@ -1,8 +1,3 @@
-https://bugs.gentoo.org/942013
-https://bugs.gentoo.org/942884
-https://github.com/rust-lang/rust/issues/131944
-https://github.com/rust-lang/rust/pull/132613
-
From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
From: Kyle Huey <khuey@kylehuey.com>
Date: Mon, 4 Nov 2024 11:38:14 -0800
@@ -26,8 +21,8 @@ Fixes #131944
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
use rustc_codegen_ssa::traits::*;
+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::bit_set::BitSet;
use rustc_index::Idx;
+ use rustc_index::bit_set::BitSet;
use rustc_middle::mir::{Body, SourceScope};
use rustc_middle::ty::layout::FnAbiOf;
use rustc_middle::ty::{self, Instance};
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 48c8af30a4e4337ac1db4d5e1e011c0ce091c149
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=48c8af30
Add patches for Rust 1.82.0-r103
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.82.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.79.0-revert-8c40426.patch | 16 ---
1.82.0-dwarf-llvm-assertion.patch | 225 ++++++++++++++++++++++++++++++++++++++
2 files changed, 225 insertions(+), 16 deletions(-)
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
deleted file mode 100644
index 3d1bb75..0000000
--- a/1.79.0-revert-8c40426.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
-
-https://bugs.gentoo.org/933382
-
---- a/src/bootstrap/src/core/build_steps/llvm.rs
-+++ b/src/bootstrap/src/core/build_steps/llvm.rs
-@@ -724,8 +724,7 @@ fn configure_cmake(
- }
- }
- cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
-- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
-- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
-+ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
- }
-
- cfg.build_arg("-j").build_arg(builder.jobs().to_string());
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.82.0-dwarf-llvm-assertion.patch
new file mode 100644
index 0000000..b23ae2f
--- /dev/null
+++ b/1.82.0-dwarf-llvm-assertion.patch
@@ -0,0 +1,225 @@
+https://bugs.gentoo.org/942013
+https://bugs.gentoo.org/942884
+https://github.com/rust-lang/rust/issues/131944
+https://github.com/rust-lang/rust/pull/132613
+
+From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
+From: Kyle Huey <khuey@kylehuey.com>
+Date: Mon, 4 Nov 2024 11:38:14 -0800
+Subject: [PATCH] Add discriminators to DILocations when multiple functions are
+ inlined into a single point.
+
+LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
+location with different values. proc-macros make it possible for arbitrary code,
+including multiple calls that get inlined, to happen at any given location in the source
+code. Add discriminators when that happens so these locations are different to LLVM.
+
+This may interfere with the AddDiscriminators pass in LLVM, which is added by the
+unstable flag -Zdebug-info-for-profiling.
+
+Fixes #131944
+--- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
++++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
+@@ -1,11 +1,15 @@
++use std::collections::hash_map::Entry;
++
+ use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
+ use rustc_codegen_ssa::traits::*;
++use rustc_data_structures::fx::FxHashMap;
+ use rustc_index::bit_set::BitSet;
+ use rustc_index::Idx;
+ use rustc_middle::mir::{Body, SourceScope};
+ use rustc_middle::ty::layout::FnAbiOf;
+ use rustc_middle::ty::{self, Instance};
+ use rustc_session::config::DebugInfo;
++use rustc_span::BytePos;
+
+ use super::metadata::file_metadata;
+ use super::utils::DIB;
+@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
+ None
+ };
+ let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
++ let mut discriminators = FxHashMap::default();
+ // Instantiate all scopes.
+ for idx in 0..mir.source_scopes.len() {
+ let scope = SourceScope::new(idx);
+- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ &variables,
++ debug_context,
++ &mut instantiated,
++ &mut discriminators,
++ scope,
++ );
+ }
+ assert!(instantiated.count() == mir.source_scopes.len());
+ }
+@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
+ variables: &Option<BitSet<SourceScope>>,
+ debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
+ instantiated: &mut BitSet<SourceScope>,
++ discriminators: &mut FxHashMap<BytePos, u32>,
+ scope: SourceScope,
+ ) {
+ if instantiated.contains(scope) {
+@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
+
+ let scope_data = &mir.source_scopes[scope];
+ let parent_scope = if let Some(parent) = scope_data.parent_scope {
+- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ variables,
++ debug_context,
++ instantiated,
++ discriminators,
++ parent,
++ );
+ debug_context.scopes[parent]
+ } else {
+ // The root is the function itself.
+@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
+ // FIXME(eddyb) this doesn't account for the macro-related
+ // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
+ let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
+- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
++ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
++
++ // NB: In order to produce proper debug info for variables (particularly
++ // arguments) in multiply-inline functions, LLVM expects to see a single
++ // DILocalVariable with multiple different DILocations in the IR. While
++ // the source information for each DILocation would be identical, their
++ // inlinedAt attributes will be unique to the particular callsite.
++ //
++ // We generate DILocations here based on the callsite's location in the
++ // source code. A single location in the source code usually can't
++ // produce multiple distinct calls so this mostly works, until
++ // proc-macros get involved. A proc-macro can generate multiple calls
++ // at the same span, which breaks the assumption that we're going to
++ // produce a unique DILocation for every scope we process here. We
++ // have to explicitly add discriminators if we see inlines into the
++ // same source code location.
++ //
++ // Note further that we can't key this hashtable on the span itself,
++ // because these spans could have distinct SyntaxContexts. We have
++ // to key on exactly what we're giving to LLVM.
++ match discriminators.entry(callsite_span.lo()) {
++ Entry::Occupied(mut o) => {
++ *o.get_mut() += 1;
++ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
++ .expect("Failed to encode discriminator in DILocation")
++ }
++ Entry::Vacant(v) => {
++ v.insert(0);
++ loc
++ }
++ }
+ });
+
+ debug_context.scopes[scope] = DebugScope {
+--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+@@ -2174,6 +2174,10 @@ unsafe extern "C" {
+ Scope: &'a DIScope,
+ InlinedAt: Option<&'a DILocation>,
+ ) -> &'a DILocation;
++ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
++ Location: &'a DILocation,
++ BD: c_uint,
++ ) -> Option<&'a DILocation>;
+ pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
+--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
+ return wrap(Loc);
+ }
+
++extern "C" LLVMMetadataRef
++LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
++ unsigned BD) {
++ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
++ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
++ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
++}
++
+ extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
+ return dwarf::DW_OP_deref;
+ }
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
+@@ -0,0 +1,11 @@
++//@ force-host
++//@ no-prefer-dynamic
++#![crate_type = "proc-macro"]
++
++extern crate proc_macro;
++use proc_macro::*;
++
++#[proc_macro]
++pub fn square_twice(_item: TokenStream) -> TokenStream {
++ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
++}
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
+@@ -0,0 +1,53 @@
++//@ min-llvm-version: 19
++//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
++// MSVC is different because of the individual allocas.
++//@ ignore-msvc
++
++//@ aux-build:macro_def.rs
++
++// Find the variable.
++// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
++
++// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
++// backwards.
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
++
++// Find the first location definition, looking forwards again.
++// CHECK: ![[#var_loc1]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
++
++// Find the first location's inlinedAt
++// NB: If we fail here it's *probably* because we failed to produce two
++// different locations and ended up reusing an earlier one.
++// CHECK: ![[#var_inlinedAt1]] = !DILocation
++// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
++
++// Find the second location definition, still looking forwards.
++// NB: If we failed to produce two different locations, the test will
++// definitely fail by this point (if it hasn't already) because we won't
++// be able to find the same line again.
++// CHECK: ![[#var_loc2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
++
++// Find the second location's inlinedAt.
++// CHECK: ![[#var_inlinedAt2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
++
++// Finally, check that a discriminator was emitted for the second scope.
++// FIXMEkhuey ideally we would check that *either* scope has a discriminator
++// but I don't know that it's possible to check that with FileCheck.
++// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
++// CHECK-SAME: discriminator: [[#]]
++extern crate macro_def;
++
++use std::env;
++
++fn square(n: i32) -> i32 {
++ n * n
++}
++
++fn main() {
++ let (z1, z2) = macro_def::square_twice!();
++ println!("{z1} == {z2}");
++}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 5c1470b83935917979064f59ef59dd32c2dba49b
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=5c1470b8
Add patches for Rust 1.84.0-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.83.0-dwarf-llvm-assertion.patch | 220 --------------------------------------
1 file changed, 220 deletions(-)
diff --git a/1.83.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
deleted file mode 100644
index 96bdac0..0000000
--- a/1.83.0-dwarf-llvm-assertion.patch
+++ /dev/null
@@ -1,220 +0,0 @@
-From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
-From: Kyle Huey <khuey@kylehuey.com>
-Date: Mon, 4 Nov 2024 11:38:14 -0800
-Subject: [PATCH] Add discriminators to DILocations when multiple functions are
- inlined into a single point.
-
-LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
-location with different values. proc-macros make it possible for arbitrary code,
-including multiple calls that get inlined, to happen at any given location in the source
-code. Add discriminators when that happens so these locations are different to LLVM.
-
-This may interfere with the AddDiscriminators pass in LLVM, which is added by the
-unstable flag -Zdebug-info-for-profiling.
-
-Fixes #131944
---- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-+++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-@@ -1,11 +1,15 @@
-+use std::collections::hash_map::Entry;
-+
- use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
- use rustc_codegen_ssa::traits::*;
-+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::Idx;
- use rustc_index::bit_set::BitSet;
- use rustc_middle::mir::{Body, SourceScope};
- use rustc_middle::ty::layout::FnAbiOf;
- use rustc_middle::ty::{self, Instance};
- use rustc_session::config::DebugInfo;
-+use rustc_span::BytePos;
-
- use super::metadata::file_metadata;
- use super::utils::DIB;
-@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
- None
- };
- let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
-+ let mut discriminators = FxHashMap::default();
- // Instantiate all scopes.
- for idx in 0..mir.source_scopes.len() {
- let scope = SourceScope::new(idx);
-- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ &variables,
-+ debug_context,
-+ &mut instantiated,
-+ &mut discriminators,
-+ scope,
-+ );
- }
- assert!(instantiated.count() == mir.source_scopes.len());
- }
-@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
- variables: &Option<BitSet<SourceScope>>,
- debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
- instantiated: &mut BitSet<SourceScope>,
-+ discriminators: &mut FxHashMap<BytePos, u32>,
- scope: SourceScope,
- ) {
- if instantiated.contains(scope) {
-@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
-
- let scope_data = &mir.source_scopes[scope];
- let parent_scope = if let Some(parent) = scope_data.parent_scope {
-- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ variables,
-+ debug_context,
-+ instantiated,
-+ discriminators,
-+ parent,
-+ );
- debug_context.scopes[parent]
- } else {
- // The root is the function itself.
-@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
- // FIXME(eddyb) this doesn't account for the macro-related
- // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
- let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
-- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
-+ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
-+
-+ // NB: In order to produce proper debug info for variables (particularly
-+ // arguments) in multiply-inline functions, LLVM expects to see a single
-+ // DILocalVariable with multiple different DILocations in the IR. While
-+ // the source information for each DILocation would be identical, their
-+ // inlinedAt attributes will be unique to the particular callsite.
-+ //
-+ // We generate DILocations here based on the callsite's location in the
-+ // source code. A single location in the source code usually can't
-+ // produce multiple distinct calls so this mostly works, until
-+ // proc-macros get involved. A proc-macro can generate multiple calls
-+ // at the same span, which breaks the assumption that we're going to
-+ // produce a unique DILocation for every scope we process here. We
-+ // have to explicitly add discriminators if we see inlines into the
-+ // same source code location.
-+ //
-+ // Note further that we can't key this hashtable on the span itself,
-+ // because these spans could have distinct SyntaxContexts. We have
-+ // to key on exactly what we're giving to LLVM.
-+ match discriminators.entry(callsite_span.lo()) {
-+ Entry::Occupied(mut o) => {
-+ *o.get_mut() += 1;
-+ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
-+ .expect("Failed to encode discriminator in DILocation")
-+ }
-+ Entry::Vacant(v) => {
-+ v.insert(0);
-+ loc
-+ }
-+ }
- });
-
- debug_context.scopes[scope] = DebugScope {
---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-@@ -2174,6 +2174,10 @@ unsafe extern "C" {
- Scope: &'a DIScope,
- InlinedAt: Option<&'a DILocation>,
- ) -> &'a DILocation;
-+ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
-+ Location: &'a DILocation,
-+ BD: c_uint,
-+ ) -> Option<&'a DILocation>;
- pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
- pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
- pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
- return wrap(Loc);
- }
-
-+extern "C" LLVMMetadataRef
-+LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
-+ unsigned BD) {
-+ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
-+ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
-+ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
-+}
-+
- extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
- return dwarf::DW_OP_deref;
- }
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
-@@ -0,0 +1,11 @@
-+//@ force-host
-+//@ no-prefer-dynamic
-+#![crate_type = "proc-macro"]
-+
-+extern crate proc_macro;
-+use proc_macro::*;
-+
-+#[proc_macro]
-+pub fn square_twice(_item: TokenStream) -> TokenStream {
-+ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
-+}
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
-@@ -0,0 +1,53 @@
-+//@ min-llvm-version: 19
-+//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
-+// MSVC is different because of the individual allocas.
-+//@ ignore-msvc
-+
-+//@ aux-build:macro_def.rs
-+
-+// Find the variable.
-+// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
-+
-+// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
-+// backwards.
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
-+
-+// Find the first location definition, looking forwards again.
-+// CHECK: ![[#var_loc1]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
-+
-+// Find the first location's inlinedAt
-+// NB: If we fail here it's *probably* because we failed to produce two
-+// different locations and ended up reusing an earlier one.
-+// CHECK: ![[#var_inlinedAt1]] = !DILocation
-+// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
-+
-+// Find the second location definition, still looking forwards.
-+// NB: If we failed to produce two different locations, the test will
-+// definitely fail by this point (if it hasn't already) because we won't
-+// be able to find the same line again.
-+// CHECK: ![[#var_loc2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
-+
-+// Find the second location's inlinedAt.
-+// CHECK: ![[#var_inlinedAt2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
-+
-+// Finally, check that a discriminator was emitted for the second scope.
-+// FIXMEkhuey ideally we would check that *either* scope has a discriminator
-+// but I don't know that it's possible to check that with FileCheck.
-+// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
-+// CHECK-SAME: discriminator: [[#]]
-+extern crate macro_def;
-+
-+use std::env;
-+
-+fn square(n: i32) -> i32 {
-+ n * n
-+}
-+
-+fn main() {
-+ let (z1, z2) = macro_def::square_twice!();
-+ println!("{z1} == {z2}");
-+}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 9f077f8e6686ab58d2947e549c22bb94e81cd0b9
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:17 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:17 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=9f077f8e
Add patches for Rust 1.84.1-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.84.1-fix-cross.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.84.1-fix-cross.patch | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
new file mode 100644
index 0000000..47d7766
--- /dev/null
+++ b/1.84.1-fix-cross.patch
@@ -0,0 +1,30 @@
+https://github.com/rust-lang/rust/issues/133629
+https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
+
+From: onur-ozkan <work@onurozkan.dev>
+Date: Thu, 30 Jan 2025 16:51:08 +0000
+Subject: [PATCH] set rustc dylib on manually constructed rustc command
+
+Signed-off-by: onur-ozkan <work@onurozkan.dev>
+--- a/src/bootstrap/src/core/builder/cargo.rs
++++ b/src/bootstrap/src/core/builder/cargo.rs
+@@ -653,7 +653,10 @@ impl Builder<'_> {
+ // Build proc macros both for the host and the target unless proc-macros are not
+ // supported by the target.
+ if target != compiler.host && cmd_kind != Kind::Check {
+- let error = command(self.rustc(compiler))
++ let mut rustc_cmd = command(self.rustc(compiler));
++ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
++
++ let error = rustc_cmd
+ .arg("--target")
+ .arg(target.rustc_target_arg())
+ .arg("--print=file-names")
+@@ -661,6 +664,7 @@ impl Builder<'_> {
+ .arg("-")
+ .run_capture(self)
+ .stderr();
++
+ let not_supported = error
+ .lines()
+ .any(|line| line.contains("unsupported crate type `proc-macro`"));
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 20675dbdc8248b31a8de752bfccb8dad6e3c9b03
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:18 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:18 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=20675dbd
Add patches for Rust 1.85.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.78.0-musl-dynamic-linking.patch | 19 --
1.84.1-fix-cross.patch | 30 ---
...e-libz.patch => 1.85.0-cross-compile-libz.patch | 19 +-
1.85.0-musl-dynamic-linking.patch | 214 +++++++++++++++++++++
4 files changed, 227 insertions(+), 55 deletions(-)
diff --git a/1.78.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
deleted file mode 100644
index 25a281c..0000000
--- a/1.78.0-musl-dynamic-linking.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 2 Aug 2022 18:32:53 -0500
-Subject: [PATCH] Enable dynamic linking by default for musl
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/compiler/rustc_target/src/spec/base/linux_musl.rs
-+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
-@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
-
- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
-
- base
- }
---
-2.35.1
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
deleted file mode 100644
index 47d7766..0000000
--- a/1.84.1-fix-cross.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-https://github.com/rust-lang/rust/issues/133629
-https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
-
-From: onur-ozkan <work@onurozkan.dev>
-Date: Thu, 30 Jan 2025 16:51:08 +0000
-Subject: [PATCH] set rustc dylib on manually constructed rustc command
-
-Signed-off-by: onur-ozkan <work@onurozkan.dev>
---- a/src/bootstrap/src/core/builder/cargo.rs
-+++ b/src/bootstrap/src/core/builder/cargo.rs
-@@ -653,7 +653,10 @@ impl Builder<'_> {
- // Build proc macros both for the host and the target unless proc-macros are not
- // supported by the target.
- if target != compiler.host && cmd_kind != Kind::Check {
-- let error = command(self.rustc(compiler))
-+ let mut rustc_cmd = command(self.rustc(compiler));
-+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
-+
-+ let error = rustc_cmd
- .arg("--target")
- .arg(target.rustc_target_arg())
- .arg("--print=file-names")
-@@ -661,6 +664,7 @@ impl Builder<'_> {
- .arg("-")
- .run_capture(self)
- .stderr();
-+
- let not_supported = error
- .lines()
- .any(|line| line.contains("unsupported crate type `proc-macro`"));
diff --git a/1.83.0-cross-compile-libz.patch b/1.85.0-cross-compile-libz.patch
similarity index 50%
rename from 1.83.0-cross-compile-libz.patch
rename to 1.85.0-cross-compile-libz.patch
index 1eac04b..7bd45c4 100644
--- a/1.83.0-cross-compile-libz.patch
+++ b/1.85.0-cross-compile-libz.patch
@@ -1,19 +1,26 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+From 768f7e50a6d9a3db4e4eef45dcb4c56e9b580389 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <kangie@gentoo.org>
+Date: Sun, 9 Feb 2025 21:12:43 +1000
+Subject: [PATCH] Update libz cross-compile patch for 9999 (1.86.0)
+See-also: https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+See-also: https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -220,12 +220,7 @@
+@@ -219,13 +219,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--libs");
-
-- // Don't link system libs if cross-compiling unless targetting Windows.
+-
+- // Don't link system libs if cross-compiling unless targeting Windows.
- // On Windows system DLLs aren't linked directly, instead import libraries are used.
- // These import libraries are independent of the host.
- if !is_crossed || target.contains("windows") {
- cmd.arg("--system-libs");
- }
+ cmd.arg("--system-libs");
-
+
// We need libkstat for getHostCPUName on SPARC builds.
// See also: https://github.com/llvm/llvm-project/issues/64186
+--
+2.48.0
diff --git a/1.85.0-musl-dynamic-linking.patch b/1.85.0-musl-dynamic-linking.patch
new file mode 100644
index 0000000..e54cadf
--- /dev/null
+++ b/1.85.0-musl-dynamic-linking.patch
@@ -0,0 +1,214 @@
+From be965af5421e55c0032a989b220bc0da005d2272 Mon Sep 17 00:00:00 2001
+From: Michal Rostecki <vadorovsky@protonmail.com>
+Date: Tue, 25 Feb 2025 16:24:21 +0100
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
+@@ -12,9 +12,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+-
+ Target {
+ llvm_target: "aarch64-unknown-linux-musl".into(),
+ metadata: crate::spec::TargetMetadata {
+--- 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 {
+ features: "+strict-align,+v6".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()
+ },
+ }
+--- 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 {
+ features: "+strict-align,+v6,+vfp2,-d32".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()
+ },
+ }
+--- 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 {
+ max_atomic_width: Some(32),
+ mcount: "\u{1}mcount".into(),
+ has_thumb_interworking: true,
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- crt_static_default: true,
++ crt_static_default: false,
+ ..base::linux_musl::opts()
+ },
+ }
+--- 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 {
+ features: "+v7,+thumb2,+soft-float,-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()
+ },
+ }
+--- 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 {
+ features: "+v7,+vfp3,-d32,+thumb2,-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()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs
+@@ -4,7 +4,5 @@ pub(crate) fn target() -> Target {
+ let mut base = super::i686_unknown_linux_musl::target();
+ base.cpu = "pentium".into();
+ base.llvm_target = "i586-unknown-linux-musl".into();
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ base
+ }
+--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
+@@ -6,8 +6,6 @@ pub(crate) fn target() -> Target {
+ base.max_atomic_width = Some(64);
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-melf_i386"]);
+ base.stack_probes = StackProbeType::Inline;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ // The unwinder used by i686-unknown-linux-musl, the LLVM libunwind
+ // implementation, apparently relies on frame pointers existing... somehow.
+--- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
++++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
+@@ -22,8 +22,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,
+ ..base
+ },
+ }
+--- 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,6 @@ pub(crate) fn target() -> Target {
+ base.cpu = "mips64r2".into();
+ base.features = "+mips64r2".into();
+ base.max_atomic_width = Some(64);
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ Target {
+ // LLVM doesn't recognize "muslabi64" yet.
+ llvm_target: "mips64el-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
+@@ -7,8 +7,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
+@@ -6,8 +6,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64le-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
+@@ -6,8 +6,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(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
+@@ -6,8 +6,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(),
+--- 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()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
+@@ -12,8 +12,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(),
+--- 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()
+ },
+ }
+--- 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
+@@ -14,8 +14,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+ base.supports_xray = true;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ Target {
+ llvm_target: "x86_64-unknown-linux-musl".into(),
+--
+2.45.3
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 0e36cbd731818725b239eed6933805a7ea57f5d0
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:18 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:18 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=0e36cbd7
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
@ 2025-06-02 9:34 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:34 UTC (permalink / raw
To: gentoo-commits
commit: 1ec6b3f396dbaddafc4caaa12cd82f929c703459
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:22:18 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:22:18 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=1ec6b3f3
Add patches for Rust 1.87.0-r1
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.87.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 -----------------------------------------------------
1.87.0-znver.patch | 9 +++
2 files changed, 9 insertions(+), 180 deletions(-)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
deleted file mode 100644
index 634a50f..0000000
--- a/1.86.0-znver.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-https://github.com/rust-lang/rust/issues/138054
-https://bugs.gentoo.org/953109#c7
---- a/library/portable-simd/crates/core_simd/src/lib.rs
-+++ b/library/portable-simd/crates/core_simd/src/lib.rs
-@@ -35,7 +35,11 @@
- feature(stdarch_x86_avx512)
- )]
- #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
--#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
-+#![deny(
-+ unsafe_op_in_unsafe_fn,
-+ unreachable_pub,
-+ clippy::undocumented_unsafe_blocks
-+)]
- #![doc(test(attr(deny(warnings))))]
- #![allow(internal_features)]
- #![unstable(feature = "portable_simd", issue = "86656")]
---- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-@@ -5,7 +5,7 @@ use core::marker::PhantomData;
-
- /// A mask where each lane is represented by a single bit.
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(
-+pub(crate) struct Mask<T, const N: usize>(
- <LaneCount<N> as SupportedLaneCount>::BitMask,
- PhantomData<T>,
- )
-@@ -78,7 +78,7 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- if value {
- mask.as_mut().fill(u8::MAX)
-@@ -93,12 +93,12 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- unsafe {
- self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
- }
-@@ -106,7 +106,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- unsafe {
- core::intrinsics::simd::simd_select_bitmask(
- self.0,
-@@ -118,19 +118,19 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
- }
-
- #[inline]
-- pub fn to_bitmask_integer(self) -> u64 {
-+ pub(crate) fn to_bitmask_integer(self) -> u64 {
- let mut bitmask = [0u8; 8];
- bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
- u64::from_ne_bytes(bitmask)
- }
-
- #[inline]
-- pub fn from_bitmask_integer(bitmask: u64) -> Self {
-+ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
- let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- let len = bytes.as_mut().len();
- bytes
-@@ -141,7 +141,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -151,13 +151,13 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- self != Self::splat(false)
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- self == Self::splat(true)
- }
- }
---- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-@@ -3,7 +3,7 @@
- use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
-
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(Simd<T, N>)
-+pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
- where
- T: MaskElement,
- LaneCount<N>: SupportedLaneCount;
-@@ -103,36 +103,36 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- T::eq(self.0[lane], T::TRUE)
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- self.0[lane] = if value { T::TRUE } else { T::FALSE }
- }
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- self.0
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- Self(value)
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -221,14 +221,14 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
- }
diff --git a/1.87.0-znver.patch b/1.87.0-znver.patch
new file mode 100644
index 0000000..11424a4
--- /dev/null
+++ b/1.87.0-znver.patch
@@ -0,0 +1,9 @@
+https://bugs.gentoo.org/956018#c3
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -1,4 +1,5 @@
+ #![allow(unused_imports)]
++#![allow(unused_attributes)]
+ use super::MaskElement;
+ use crate::simd::{LaneCount, Simd, SupportedLaneCount};
+ use core::marker::PhantomData;
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.86 commit in: /
@ 2025-06-02 9:48 Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
` (5 more replies)
0 siblings, 6 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
@ 2025-06-02 9:48 ` Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.88 " Matt Jolly
` (4 subsequent siblings)
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.88 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
@ 2025-06-02 9:48 ` Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:master " Matt Jolly
` (3 subsequent siblings)
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:master commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.88 " Matt Jolly
@ 2025-06-02 9:48 ` Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.86.0-r2 " Matt Jolly
` (2 subsequent siblings)
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:48 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.86.0-r2 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
` (2 preceding siblings ...)
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:master " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 " Matt Jolly
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 3c0c82412ea438ded6533022a9a026e2ce295bbb
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=3c0c8241
Initial commit with README
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
README.rst | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..9999e72
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,24 @@
+###################
+Gentoo Rust Patches
+###################
+
+This repository contains patches required to build Rust on Gentoo Linux. These patches were previously
+part of the main Gentoo repository but have been moved here due to their size and to make maintenance easier.
+
+The patches are applied to the Rust source code during the build process. They address various issues such as
+compatibility with the Gentoo environment, specific compiler flags, and other adjustments needed for a successful build,
+or are backports to fix specific issues.
+
+Usage
+=====
+
+A branch will be created for each new Rust release (e.g. ``1.88``), and patches will be added to that branch as needed.
+
+Tags for ``${PV}`` will be created for each release, e.g. ``1.88.0``, ``1.88.1``, etc., to track the specific versions of
+Rust that these patches apply to. Revbumps will be tagged as required - if a patch is added or updated, a tag will be
+created for the new version (e.g. ``1.88.0-r1``).
+
+``master`` will contain patches required for ``nightly`` (live / ``9999``) ebuilds and will be updated as needed.
+
+To use the patches, you can clone this repository and apply the patches to the Rust source code before building
+(or use the Gentoo ebuild system which will handle this automatically!).
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 0e1b58fe7443c58d224889526912952cd2436cc3
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=0e1b58fe
Add patches for Rust 1.75.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 39 ++++++++++++++++++++++
...king.patch => 1.75.0-musl-dynamic-linking.patch | 4 +--
2 files changed, 41 insertions(+), 2 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
new file mode 100644
index 0000000..5d39022
--- /dev/null
+++ b/1.75.0-handle-vendored-sources.patch
@@ -0,0 +1,39 @@
+From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
+From: Arlo Siemsen <arsiem@microsoft.com>
+Date: Thu, 4 Jan 2024 11:40:56 -0600
+Subject: [PATCH] Handle vendored sources when remapping paths
+
+Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
+--- a/src/bootstrap/src/core/builder.rs
++++ b/src/bootstrap/src/core/builder.rs
+@@ -1799,15 +1799,20 @@ pub fn cargo(
+ }
+
+ if self.config.rust_remap_debuginfo {
+- // FIXME: handle vendored sources
+- let registry_src = t!(home::cargo_home()).join("registry").join("src");
+ let mut env_var = OsString::new();
+- for entry in t!(std::fs::read_dir(registry_src)) {
+- if !env_var.is_empty() {
+- env_var.push("\t");
+- }
+- env_var.push(t!(entry).path());
++ if self.config.vendor {
++ let vendor = self.build.src.join("vendor");
++ env_var.push(vendor);
+ env_var.push("=/rust/deps");
++ } else {
++ let registry_src = t!(home::cargo_home()).join("registry").join("src");
++ for entry in t!(std::fs::read_dir(registry_src)) {
++ if !env_var.is_empty() {
++ env_var.push("\t");
++ }
++ env_var.push(t!(entry).path());
++ env_var.push("=/rust/deps");
++ }
+ }
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
+ }
+--
+2.43.0
+
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.75.0-musl-dynamic-linking.patch
similarity index 82%
rename from 1.62.1-musl-dynamic-linking.patch
rename to 1.75.0-musl-dynamic-linking.patch
index b64775c..7dc34f8 100644
--- a/1.62.1-musl-dynamic-linking.patch
+++ b/1.75.0-musl-dynamic-linking.patch
@@ -4,8 +4,8 @@ Date: Tue, 2 Aug 2022 18:32:53 -0500
Subject: [PATCH] Enable dynamic linking by default for musl
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
++++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 1b769dd682fdbe71091de1d7105086324f9c42a3
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=1b769dd6
Add patches for Rust 1.74.1-r101
Patches:
- 1.62.1-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.62.1-musl-dynamic-linking.patch | 19 +++++++++++++++
1.67.0-doc-wasm.patch | 28 ++++++++++++++++++++++
....0-ignore-broken-and-non-applicable-tests.patch | 24 +++++++++++++++++++
1.74.1-cross-compile-libz.patch | 17 +++++++++++++
1.81.0-backport-bug937164.patch | 15 ++++++++++++
1.81.0-backport-llvm-pr101761.patch | 24 +++++++++++++++++++
1.81.0-backport-llvm-pr101766.patch | 23 ++++++++++++++++++
7 files changed, 150 insertions(+)
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.62.1-musl-dynamic-linking.patch
new file mode 100644
index 0000000..b64775c
--- /dev/null
+++ b/1.62.1-musl-dynamic-linking.patch
@@ -0,0 +1,19 @@
+From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Tue, 2 Aug 2022 18:32:53 -0500
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
+ 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.35.1
diff --git a/1.67.0-doc-wasm.patch b/1.67.0-doc-wasm.patch
new file mode 100644
index 0000000..30cb8b9
--- /dev/null
+++ b/1.67.0-doc-wasm.patch
@@ -0,0 +1,28 @@
+From 92aa5f6b272bcdc020a34f8d90f9ef851b5b4504 Mon Sep 17 00:00:00 2001
+From: John Millikin <john@john-millikin.com>
+Date: Mon, 9 Jan 2023 13:54:21 +0900
+Subject: [PATCH] Disable `linux_ext` in wasm32 and fortanix rustdoc builds.
+
+The `std::os::unix` module is stubbed out when building docs for these
+target platforms. The introduction of Linux-specific extension traits
+caused `std::os::net` to depend on sub-modules of `std::os::unix`,
+which broke rustdoc for the `wasm32-unknown-unknown` target.
+
+Adding an additional `#[cfg]` guard solves that rustdoc failure by
+not declaring `linux_ext` on targets with a stubbed `std::os::unix`.
+--- a/library/std/src/os/net/mod.rs
++++ b/library/std/src/os/net/mod.rs
+@@ -1,4 +1,13 @@
+ //! OS-specific networking functionality.
+
++// See cfg macros in `library/std/src/os/mod.rs` for why these platforms must
++// be special-cased during rustdoc generation.
++#[cfg(not(all(
++ doc,
++ any(
++ all(target_arch = "wasm32", not(target_os = "wasi")),
++ all(target_vendor = "fortanix", target_env = "sgx")
++ )
++)))]
+ #[cfg(any(target_os = "linux", target_os = "android", doc))]
+ pub(super) mod linux_ext;
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.70.0-ignore-broken-and-non-applicable-tests.patch
new file mode 100644
index 0000000..590f960
--- /dev/null
+++ b/1.70.0-ignore-broken-and-non-applicable-tests.patch
@@ -0,0 +1,24 @@
+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
+--- a/tests/ui/env-funky-keys.rs
++++ b/tests/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/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
new file mode 100644
index 0000000..98cec09
--- /dev/null
+++ b/1.74.1-cross-compile-libz.patch
@@ -0,0 +1,17 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -237,10 +237,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+-
+- if !is_crossed {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ if (target.starts_with("arm") && !target.contains("freebsd"))
+ || target.starts_with("mips-")
diff --git a/1.81.0-backport-bug937164.patch b/1.81.0-backport-bug937164.patch
new file mode 100644
index 0000000..a6e887d
--- /dev/null
+++ b/1.81.0-backport-bug937164.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+
+Unnecessary on 19+ because 2222fddfc0a2ff02036542511597839856289094 adds
+SmallVector and SmallVector is fixed by another patch.
+--- a/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
++++ b/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+@@ -13,6 +13,7 @@
+ #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+ #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+ #include <string>
+
diff --git a/1.81.0-backport-llvm-pr101761.patch b/1.81.0-backport-llvm-pr101761.patch
new file mode 100644
index 0000000..bcc3fee
--- /dev/null
+++ b/1.81.0-backport-llvm-pr101761.patch
@@ -0,0 +1,24 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+https://github.com/llvm/llvm-project/commit/7e44305041d96b064c197216b931ae3917a34ac1
+https://github.com/llvm/llvm-project/pull/101761
+
+From 7e44305041d96b064c197216b931ae3917a34ac1 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 23:07:21 +0100
+Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
+
+SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0]
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+--- a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
++++ b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cassert>
+ #include <cstddef>
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>
diff --git a/1.81.0-backport-llvm-pr101766.patch b/1.81.0-backport-llvm-pr101766.patch
new file mode 100644
index 0000000..1bc84d0
--- /dev/null
+++ b/1.81.0-backport-llvm-pr101766.patch
@@ -0,0 +1,23 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+https://github.com/llvm/llvm-project/pull/101766
+
+From 5b69d0cf697f0d78406a5a7ed18eaa4f57a0580a Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 23:38:55 +0100
+Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
+
+createAMDGPUELFObjectWriter uses `uint8_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0].
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+--- a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
++++ b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+@@ -15,6 +15,7 @@
+ #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+ #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+
+ namespace llvm {
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
` (3 preceding siblings ...)
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.86.0-r2 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 " Matt Jolly
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496
Add patches for Rust 1.76.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
new file mode 100644
index 0000000..02bfeca
--- /dev/null
+++ b/1.76.0-loong-code-model.patch
@@ -0,0 +1,73 @@
+https://github.com/rust-lang/rust/pull/120661
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Mon, 5 Feb 2024 13:18:32 +0800
+Subject: [PATCH] target: default to the medium code model on LoongArch targets
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Rust LoongArch targets have been using the default LLVM code model
+so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
+As described in the "Code Model" section of LoongArch ELF psABI spec
+v20231219 [1], one can only make function calls as far as ±128MiB with
+the "normal" code model; this is insufficient for very large software
+containing Rust components that needs to be linked into the big text
+section, such as Chromium.
+
+Because:
+
+* we do not want to ask users to recompile std if they are to build
+ such software,
+* objects compiled with larger code models can be linked with those
+ with smaller code models without problems, and
+* the "medium" code model is comparable to the "small"/"normal" one
+ performance-wise (same data access pattern; each function call
+ becomes 2-insn long and indirect, but this may be relaxed back into
+ the direct 1-insn form in a future LLVM version), but is able to
+ perform function calls within ±128GiB,
+
+it is better to just switch the targets to the "medium" code model,
+which is also "medium" in LLVM-speak.
+
+[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
+@@ -1,4 +1,4 @@
+-use crate::spec::{base, Target, TargetOptions};
++use crate::spec::{base, CodeModel, Target, TargetOptions};
+
+ pub fn target() -> Target {
+ Target {
+@@ -7,6 +7,7 @@ pub fn target() -> Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
+ arch: "loongarch64".into(),
+ options: TargetOptions {
++ code_model: Some(CodeModel::Medium),
+ cpu: "generic".into(),
+ features: "+f,+d".into(),
+ llvm_abiname: "lp64d".into(),
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+@@ -16,7 +16,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
+@@ -17,7 +17,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--
+2.43.0
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 641e913b060eebb74e65070cf974535db2225f4b
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=641e913b
Add patches for Rust 1.77.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 39 ------------------------------------
1 file changed, 39 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
deleted file mode 100644
index 5d39022..0000000
--- a/1.75.0-handle-vendored-sources.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
-From: Arlo Siemsen <arsiem@microsoft.com>
-Date: Thu, 4 Jan 2024 11:40:56 -0600
-Subject: [PATCH] Handle vendored sources when remapping paths
-
-Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---- a/src/bootstrap/src/core/builder.rs
-+++ b/src/bootstrap/src/core/builder.rs
-@@ -1799,15 +1799,20 @@ pub fn cargo(
- }
-
- if self.config.rust_remap_debuginfo {
-- // FIXME: handle vendored sources
-- let registry_src = t!(home::cargo_home()).join("registry").join("src");
- let mut env_var = OsString::new();
-- for entry in t!(std::fs::read_dir(registry_src)) {
-- if !env_var.is_empty() {
-- env_var.push("\t");
-- }
-- env_var.push(t!(entry).path());
-+ if self.config.vendor {
-+ let vendor = self.build.src.join("vendor");
-+ env_var.push(vendor);
- env_var.push("=/rust/deps");
-+ } else {
-+ let registry_src = t!(home::cargo_home()).join("registry").join("src");
-+ for entry in t!(std::fs::read_dir(registry_src)) {
-+ if !env_var.is_empty() {
-+ env_var.push("\t");
-+ }
-+ env_var.push(t!(entry).path());
-+ env_var.push("=/rust/deps");
-+ }
- }
- cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
- }
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: bdf58e68b15514236423536e45aa645c698f0753
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=bdf58e68
Add patches for Rust 1.80.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
....0-ignore-broken-and-non-applicable-tests.patch | 24 ----------------------
1 file changed, 24 deletions(-)
diff --git a/1.78.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
deleted file mode 100644
index 742c81a..0000000
--- a/1.78.0-ignore-broken-and-non-applicable-tests.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-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
---- a/tests/ui/env-funky-keys.rs
-+++ b/tests/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
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 12cbabf1bf6482e7046a73cd59ba7aa0662f4bf8
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=12cbabf1
Add patches for Rust 1.84.0-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.83.0-dwarf-llvm-assertion.patch | 220 --------------------------------------
1 file changed, 220 deletions(-)
diff --git a/1.83.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
deleted file mode 100644
index 96bdac0..0000000
--- a/1.83.0-dwarf-llvm-assertion.patch
+++ /dev/null
@@ -1,220 +0,0 @@
-From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
-From: Kyle Huey <khuey@kylehuey.com>
-Date: Mon, 4 Nov 2024 11:38:14 -0800
-Subject: [PATCH] Add discriminators to DILocations when multiple functions are
- inlined into a single point.
-
-LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
-location with different values. proc-macros make it possible for arbitrary code,
-including multiple calls that get inlined, to happen at any given location in the source
-code. Add discriminators when that happens so these locations are different to LLVM.
-
-This may interfere with the AddDiscriminators pass in LLVM, which is added by the
-unstable flag -Zdebug-info-for-profiling.
-
-Fixes #131944
---- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-+++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-@@ -1,11 +1,15 @@
-+use std::collections::hash_map::Entry;
-+
- use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
- use rustc_codegen_ssa::traits::*;
-+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::Idx;
- use rustc_index::bit_set::BitSet;
- use rustc_middle::mir::{Body, SourceScope};
- use rustc_middle::ty::layout::FnAbiOf;
- use rustc_middle::ty::{self, Instance};
- use rustc_session::config::DebugInfo;
-+use rustc_span::BytePos;
-
- use super::metadata::file_metadata;
- use super::utils::DIB;
-@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
- None
- };
- let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
-+ let mut discriminators = FxHashMap::default();
- // Instantiate all scopes.
- for idx in 0..mir.source_scopes.len() {
- let scope = SourceScope::new(idx);
-- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ &variables,
-+ debug_context,
-+ &mut instantiated,
-+ &mut discriminators,
-+ scope,
-+ );
- }
- assert!(instantiated.count() == mir.source_scopes.len());
- }
-@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
- variables: &Option<BitSet<SourceScope>>,
- debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
- instantiated: &mut BitSet<SourceScope>,
-+ discriminators: &mut FxHashMap<BytePos, u32>,
- scope: SourceScope,
- ) {
- if instantiated.contains(scope) {
-@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
-
- let scope_data = &mir.source_scopes[scope];
- let parent_scope = if let Some(parent) = scope_data.parent_scope {
-- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ variables,
-+ debug_context,
-+ instantiated,
-+ discriminators,
-+ parent,
-+ );
- debug_context.scopes[parent]
- } else {
- // The root is the function itself.
-@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
- // FIXME(eddyb) this doesn't account for the macro-related
- // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
- let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
-- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
-+ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
-+
-+ // NB: In order to produce proper debug info for variables (particularly
-+ // arguments) in multiply-inline functions, LLVM expects to see a single
-+ // DILocalVariable with multiple different DILocations in the IR. While
-+ // the source information for each DILocation would be identical, their
-+ // inlinedAt attributes will be unique to the particular callsite.
-+ //
-+ // We generate DILocations here based on the callsite's location in the
-+ // source code. A single location in the source code usually can't
-+ // produce multiple distinct calls so this mostly works, until
-+ // proc-macros get involved. A proc-macro can generate multiple calls
-+ // at the same span, which breaks the assumption that we're going to
-+ // produce a unique DILocation for every scope we process here. We
-+ // have to explicitly add discriminators if we see inlines into the
-+ // same source code location.
-+ //
-+ // Note further that we can't key this hashtable on the span itself,
-+ // because these spans could have distinct SyntaxContexts. We have
-+ // to key on exactly what we're giving to LLVM.
-+ match discriminators.entry(callsite_span.lo()) {
-+ Entry::Occupied(mut o) => {
-+ *o.get_mut() += 1;
-+ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
-+ .expect("Failed to encode discriminator in DILocation")
-+ }
-+ Entry::Vacant(v) => {
-+ v.insert(0);
-+ loc
-+ }
-+ }
- });
-
- debug_context.scopes[scope] = DebugScope {
---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-@@ -2174,6 +2174,10 @@ unsafe extern "C" {
- Scope: &'a DIScope,
- InlinedAt: Option<&'a DILocation>,
- ) -> &'a DILocation;
-+ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
-+ Location: &'a DILocation,
-+ BD: c_uint,
-+ ) -> Option<&'a DILocation>;
- pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
- pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
- pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
- return wrap(Loc);
- }
-
-+extern "C" LLVMMetadataRef
-+LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
-+ unsigned BD) {
-+ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
-+ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
-+ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
-+}
-+
- extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
- return dwarf::DW_OP_deref;
- }
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
-@@ -0,0 +1,11 @@
-+//@ force-host
-+//@ no-prefer-dynamic
-+#![crate_type = "proc-macro"]
-+
-+extern crate proc_macro;
-+use proc_macro::*;
-+
-+#[proc_macro]
-+pub fn square_twice(_item: TokenStream) -> TokenStream {
-+ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
-+}
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
-@@ -0,0 +1,53 @@
-+//@ min-llvm-version: 19
-+//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
-+// MSVC is different because of the individual allocas.
-+//@ ignore-msvc
-+
-+//@ aux-build:macro_def.rs
-+
-+// Find the variable.
-+// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
-+
-+// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
-+// backwards.
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
-+
-+// Find the first location definition, looking forwards again.
-+// CHECK: ![[#var_loc1]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
-+
-+// Find the first location's inlinedAt
-+// NB: If we fail here it's *probably* because we failed to produce two
-+// different locations and ended up reusing an earlier one.
-+// CHECK: ![[#var_inlinedAt1]] = !DILocation
-+// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
-+
-+// Find the second location definition, still looking forwards.
-+// NB: If we failed to produce two different locations, the test will
-+// definitely fail by this point (if it hasn't already) because we won't
-+// be able to find the same line again.
-+// CHECK: ![[#var_loc2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
-+
-+// Find the second location's inlinedAt.
-+// CHECK: ![[#var_inlinedAt2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
-+
-+// Finally, check that a discriminator was emitted for the second scope.
-+// FIXMEkhuey ideally we would check that *either* scope has a discriminator
-+// but I don't know that it's possible to check that with FileCheck.
-+// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
-+// CHECK-SAME: discriminator: [[#]]
-+extern crate macro_def;
-+
-+use std::env;
-+
-+fn square(n: i32) -> i32 {
-+ n * n
-+}
-+
-+fn main() {
-+ let (z1, z2) = macro_def::square_twice!();
-+ println!("{z1} == {z2}");
-+}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: a7abd5265a90a89fa91165edb0b225a73cff8ad9
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=a7abd526
Add patches for Rust 1.83.0-r3
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.83.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.74.1-cross-compile-libz.patch | 17 ---------------
1.81.0-backport-bug937164.patch | 15 --------------
1.81.0-backport-llvm-pr101761.patch | 24 ----------------------
1.81.0-backport-llvm-pr101766.patch | 23 ---------------------
1.83.0-cross-compile-libz.patch | 19 +++++++++++++++++
...tion.patch => 1.83.0-dwarf-llvm-assertion.patch | 7 +------
6 files changed, 20 insertions(+), 85 deletions(-)
diff --git a/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
deleted file mode 100644
index 98cec09..0000000
--- a/1.74.1-cross-compile-libz.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
-
---- a/compiler/rustc_llvm/build.rs
-+++ b/compiler/rustc_llvm/build.rs
-@@ -237,10 +237,7 @@ fn main() {
- // of llvm-config, not the target that we're attempting to link.
- let mut cmd = Command::new(&llvm_config);
- cmd.arg(llvm_link_arg).arg("--libs");
--
-- if !is_crossed {
-- cmd.arg("--system-libs");
-- }
-+ cmd.arg("--system-libs");
-
- if (target.starts_with("arm") && !target.contains("freebsd"))
- || target.starts_with("mips-")
diff --git a/1.81.0-backport-bug937164.patch b/1.81.0-backport-bug937164.patch
deleted file mode 100644
index a6e887d..0000000
--- a/1.81.0-backport-bug937164.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-
-Unnecessary on 19+ because 2222fddfc0a2ff02036542511597839856289094 adds
-SmallVector and SmallVector is fixed by another patch.
---- a/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
-+++ b/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
-@@ -13,6 +13,7 @@
- #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
- #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
-
-+#include <cstdint>
- #include <memory>
- #include <string>
-
diff --git a/1.81.0-backport-llvm-pr101761.patch b/1.81.0-backport-llvm-pr101761.patch
deleted file mode 100644
index bcc3fee..0000000
--- a/1.81.0-backport-llvm-pr101761.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-https://github.com/llvm/llvm-project/commit/7e44305041d96b064c197216b931ae3917a34ac1
-https://github.com/llvm/llvm-project/pull/101761
-
-From 7e44305041d96b064c197216b931ae3917a34ac1 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 23:07:21 +0100
-Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
-
-SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
-which fails to build w/ GCC 15 after a change in libstdc++ [0]
-
-[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
---- a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
-+++ b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
-@@ -19,6 +19,7 @@
- #include <algorithm>
- #include <cassert>
- #include <cstddef>
-+#include <cstdint>
- #include <cstdlib>
- #include <cstring>
- #include <functional>
diff --git a/1.81.0-backport-llvm-pr101766.patch b/1.81.0-backport-llvm-pr101766.patch
deleted file mode 100644
index 1bc84d0..0000000
--- a/1.81.0-backport-llvm-pr101766.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-https://github.com/llvm/llvm-project/pull/101766
-
-From 5b69d0cf697f0d78406a5a7ed18eaa4f57a0580a Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 23:38:55 +0100
-Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
-
-createAMDGPUELFObjectWriter uses `uint8_t` without including `<cstdint>`
-which fails to build w/ GCC 15 after a change in libstdc++ [0].
-
-[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
---- a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
-+++ b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
-@@ -15,6 +15,7 @@
- #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
- #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
-
-+#include <cstdint>
- #include <memory>
-
- namespace llvm {
diff --git a/1.83.0-cross-compile-libz.patch b/1.83.0-cross-compile-libz.patch
new file mode 100644
index 0000000..1eac04b
--- /dev/null
+++ b/1.83.0-cross-compile-libz.patch
@@ -0,0 +1,19 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -220,12 +220,7 @@
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+
+- // Don't link system libs if cross-compiling unless targetting Windows.
+- // On Windows system DLLs aren't linked directly, instead import libraries are used.
+- // These import libraries are independent of the host.
+- if !is_crossed || target.contains("windows") {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ // We need libkstat for getHostCPUName on SPARC builds.
+ // See also: https://github.com/llvm/llvm-project/issues/64186
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
similarity index 98%
rename from 1.82.0-dwarf-llvm-assertion.patch
rename to 1.83.0-dwarf-llvm-assertion.patch
index b23ae2f..96bdac0 100644
--- a/1.82.0-dwarf-llvm-assertion.patch
+++ b/1.83.0-dwarf-llvm-assertion.patch
@@ -1,8 +1,3 @@
-https://bugs.gentoo.org/942013
-https://bugs.gentoo.org/942884
-https://github.com/rust-lang/rust/issues/131944
-https://github.com/rust-lang/rust/pull/132613
-
From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
From: Kyle Huey <khuey@kylehuey.com>
Date: Mon, 4 Nov 2024 11:38:14 -0800
@@ -26,8 +21,8 @@ Fixes #131944
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
use rustc_codegen_ssa::traits::*;
+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::bit_set::BitSet;
use rustc_index::Idx;
+ use rustc_index::bit_set::BitSet;
use rustc_middle::mir::{Body, SourceScope};
use rustc_middle::ty::layout::FnAbiOf;
use rustc_middle::ty::{self, Instance};
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 5957bf8f719307bbbcb7a59daceeaaba360610ce
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=5957bf8f
Add patches for Rust 1.82.0-r103
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.82.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.79.0-revert-8c40426.patch | 16 ---
1.82.0-dwarf-llvm-assertion.patch | 225 ++++++++++++++++++++++++++++++++++++++
2 files changed, 225 insertions(+), 16 deletions(-)
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
deleted file mode 100644
index 3d1bb75..0000000
--- a/1.79.0-revert-8c40426.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
-
-https://bugs.gentoo.org/933382
-
---- a/src/bootstrap/src/core/build_steps/llvm.rs
-+++ b/src/bootstrap/src/core/build_steps/llvm.rs
-@@ -724,8 +724,7 @@ fn configure_cmake(
- }
- }
- cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
-- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
-- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
-+ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
- }
-
- cfg.build_arg("-j").build_arg(builder.jobs().to_string());
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.82.0-dwarf-llvm-assertion.patch
new file mode 100644
index 0000000..b23ae2f
--- /dev/null
+++ b/1.82.0-dwarf-llvm-assertion.patch
@@ -0,0 +1,225 @@
+https://bugs.gentoo.org/942013
+https://bugs.gentoo.org/942884
+https://github.com/rust-lang/rust/issues/131944
+https://github.com/rust-lang/rust/pull/132613
+
+From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
+From: Kyle Huey <khuey@kylehuey.com>
+Date: Mon, 4 Nov 2024 11:38:14 -0800
+Subject: [PATCH] Add discriminators to DILocations when multiple functions are
+ inlined into a single point.
+
+LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
+location with different values. proc-macros make it possible for arbitrary code,
+including multiple calls that get inlined, to happen at any given location in the source
+code. Add discriminators when that happens so these locations are different to LLVM.
+
+This may interfere with the AddDiscriminators pass in LLVM, which is added by the
+unstable flag -Zdebug-info-for-profiling.
+
+Fixes #131944
+--- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
++++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
+@@ -1,11 +1,15 @@
++use std::collections::hash_map::Entry;
++
+ use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
+ use rustc_codegen_ssa::traits::*;
++use rustc_data_structures::fx::FxHashMap;
+ use rustc_index::bit_set::BitSet;
+ use rustc_index::Idx;
+ use rustc_middle::mir::{Body, SourceScope};
+ use rustc_middle::ty::layout::FnAbiOf;
+ use rustc_middle::ty::{self, Instance};
+ use rustc_session::config::DebugInfo;
++use rustc_span::BytePos;
+
+ use super::metadata::file_metadata;
+ use super::utils::DIB;
+@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
+ None
+ };
+ let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
++ let mut discriminators = FxHashMap::default();
+ // Instantiate all scopes.
+ for idx in 0..mir.source_scopes.len() {
+ let scope = SourceScope::new(idx);
+- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ &variables,
++ debug_context,
++ &mut instantiated,
++ &mut discriminators,
++ scope,
++ );
+ }
+ assert!(instantiated.count() == mir.source_scopes.len());
+ }
+@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
+ variables: &Option<BitSet<SourceScope>>,
+ debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
+ instantiated: &mut BitSet<SourceScope>,
++ discriminators: &mut FxHashMap<BytePos, u32>,
+ scope: SourceScope,
+ ) {
+ if instantiated.contains(scope) {
+@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
+
+ let scope_data = &mir.source_scopes[scope];
+ let parent_scope = if let Some(parent) = scope_data.parent_scope {
+- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ variables,
++ debug_context,
++ instantiated,
++ discriminators,
++ parent,
++ );
+ debug_context.scopes[parent]
+ } else {
+ // The root is the function itself.
+@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
+ // FIXME(eddyb) this doesn't account for the macro-related
+ // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
+ let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
+- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
++ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
++
++ // NB: In order to produce proper debug info for variables (particularly
++ // arguments) in multiply-inline functions, LLVM expects to see a single
++ // DILocalVariable with multiple different DILocations in the IR. While
++ // the source information for each DILocation would be identical, their
++ // inlinedAt attributes will be unique to the particular callsite.
++ //
++ // We generate DILocations here based on the callsite's location in the
++ // source code. A single location in the source code usually can't
++ // produce multiple distinct calls so this mostly works, until
++ // proc-macros get involved. A proc-macro can generate multiple calls
++ // at the same span, which breaks the assumption that we're going to
++ // produce a unique DILocation for every scope we process here. We
++ // have to explicitly add discriminators if we see inlines into the
++ // same source code location.
++ //
++ // Note further that we can't key this hashtable on the span itself,
++ // because these spans could have distinct SyntaxContexts. We have
++ // to key on exactly what we're giving to LLVM.
++ match discriminators.entry(callsite_span.lo()) {
++ Entry::Occupied(mut o) => {
++ *o.get_mut() += 1;
++ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
++ .expect("Failed to encode discriminator in DILocation")
++ }
++ Entry::Vacant(v) => {
++ v.insert(0);
++ loc
++ }
++ }
+ });
+
+ debug_context.scopes[scope] = DebugScope {
+--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+@@ -2174,6 +2174,10 @@ unsafe extern "C" {
+ Scope: &'a DIScope,
+ InlinedAt: Option<&'a DILocation>,
+ ) -> &'a DILocation;
++ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
++ Location: &'a DILocation,
++ BD: c_uint,
++ ) -> Option<&'a DILocation>;
+ pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
+--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
+ return wrap(Loc);
+ }
+
++extern "C" LLVMMetadataRef
++LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
++ unsigned BD) {
++ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
++ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
++ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
++}
++
+ extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
+ return dwarf::DW_OP_deref;
+ }
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
+@@ -0,0 +1,11 @@
++//@ force-host
++//@ no-prefer-dynamic
++#![crate_type = "proc-macro"]
++
++extern crate proc_macro;
++use proc_macro::*;
++
++#[proc_macro]
++pub fn square_twice(_item: TokenStream) -> TokenStream {
++ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
++}
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
+@@ -0,0 +1,53 @@
++//@ min-llvm-version: 19
++//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
++// MSVC is different because of the individual allocas.
++//@ ignore-msvc
++
++//@ aux-build:macro_def.rs
++
++// Find the variable.
++// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
++
++// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
++// backwards.
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
++
++// Find the first location definition, looking forwards again.
++// CHECK: ![[#var_loc1]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
++
++// Find the first location's inlinedAt
++// NB: If we fail here it's *probably* because we failed to produce two
++// different locations and ended up reusing an earlier one.
++// CHECK: ![[#var_inlinedAt1]] = !DILocation
++// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
++
++// Find the second location definition, still looking forwards.
++// NB: If we failed to produce two different locations, the test will
++// definitely fail by this point (if it hasn't already) because we won't
++// be able to find the same line again.
++// CHECK: ![[#var_loc2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
++
++// Find the second location's inlinedAt.
++// CHECK: ![[#var_inlinedAt2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
++
++// Finally, check that a discriminator was emitted for the second scope.
++// FIXMEkhuey ideally we would check that *either* scope has a discriminator
++// but I don't know that it's possible to check that with FileCheck.
++// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
++// CHECK-SAME: discriminator: [[#]]
++extern crate macro_def;
++
++use std::env;
++
++fn square(n: i32) -> i32 {
++ n * n
++}
++
++fn main() {
++ let (z1, z2) = macro_def::square_twice!();
++ println!("{z1} == {z2}");
++}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: ad60b82acf7da85c29d507c1baa8723274864bf0
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:08 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:08 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=ad60b82a
Add patches for Rust 1.78.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.78.0-ignore-broken-and-non-applicable-tests.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 ----------------------
....0-ignore-broken-and-non-applicable-tests.patch | 12 ++--
...king.patch => 1.78.0-musl-dynamic-linking.patch | 2 +-
1.79.0-revert-8c40426.patch | 16 +++++
4 files changed, 23 insertions(+), 80 deletions(-)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
deleted file mode 100644
index 02bfeca..0000000
--- a/1.76.0-loong-code-model.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-https://github.com/rust-lang/rust/pull/120661
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Mon, 5 Feb 2024 13:18:32 +0800
-Subject: [PATCH] target: default to the medium code model on LoongArch targets
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The Rust LoongArch targets have been using the default LLVM code model
-so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
-As described in the "Code Model" section of LoongArch ELF psABI spec
-v20231219 [1], one can only make function calls as far as ±128MiB with
-the "normal" code model; this is insufficient for very large software
-containing Rust components that needs to be linked into the big text
-section, such as Chromium.
-
-Because:
-
-* we do not want to ask users to recompile std if they are to build
- such software,
-* objects compiled with larger code models can be linked with those
- with smaller code models without problems, and
-* the "medium" code model is comparable to the "small"/"normal" one
- performance-wise (same data access pattern; each function call
- becomes 2-insn long and indirect, but this may be relaxed back into
- the direct 1-insn form in a future LLVM version), but is able to
- perform function calls within ±128GiB,
-
-it is better to just switch the targets to the "medium" code model,
-which is also "medium" in LLVM-speak.
-
-[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{base, Target, TargetOptions};
-+use crate::spec::{base, CodeModel, Target, TargetOptions};
-
- pub fn target() -> Target {
- Target {
-@@ -7,6 +7,7 @@ pub fn target() -> Target {
- data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
- arch: "loongarch64".into(),
- options: TargetOptions {
-+ code_model: Some(CodeModel::Medium),
- cpu: "generic".into(),
- features: "+f,+d".into(),
- llvm_abiname: "lp64d".into(),
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-@@ -16,7 +16,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-@@ -17,7 +17,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---
-2.43.0
-
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
similarity index 80%
rename from 1.70.0-ignore-broken-and-non-applicable-tests.patch
rename to 1.78.0-ignore-broken-and-non-applicable-tests.patch
index 590f960..742c81a 100644
--- a/1.70.0-ignore-broken-and-non-applicable-tests.patch
+++ b/1.78.0-ignore-broken-and-non-applicable-tests.patch
@@ -12,13 +12,13 @@ sysroot-crates-are-unstable: can't run rustc without RPATH
--- a/tests/ui/env-funky-keys.rs
+++ b/tests/ui/env-funky-keys.rs
@@ -1,6 +1,7 @@
- // run-pass
- // Ignore this test on Android, because it segfaults there.
+ //@ run-pass
+ //@ Ignore this test on Android, because it segfaults there.
-+// ignore-test
- // ignore-android
- // ignore-windows
- // ignore-cloudabi no execve
++//@ ignore-test
+ //@ ignore-android
+ //@ ignore-windows
+ //@ ignore-cloudabi no execve
--
2.24.1
diff --git a/1.75.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
similarity index 88%
rename from 1.75.0-musl-dynamic-linking.patch
rename to 1.78.0-musl-dynamic-linking.patch
index 7dc34f8..25a281c 100644
--- a/1.75.0-musl-dynamic-linking.patch
+++ b/1.78.0-musl-dynamic-linking.patch
@@ -7,7 +7,7 @@ Signed-off-by: Jory Pratt <anarchy@gentoo.org>
--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
+ base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
// These targets statically link libc by default
- base.crt_static_default = true;
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
new file mode 100644
index 0000000..3d1bb75
--- /dev/null
+++ b/1.79.0-revert-8c40426.patch
@@ -0,0 +1,16 @@
+This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
+
+https://bugs.gentoo.org/933382
+
+--- a/src/bootstrap/src/core/build_steps/llvm.rs
++++ b/src/bootstrap/src/core/build_steps/llvm.rs
+@@ -724,8 +724,7 @@ fn configure_cmake(
+ }
+ }
+ cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
+- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
+- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
++ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
+ }
+
+ cfg.build_arg("-j").build_arg(builder.jobs().to_string());
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 30c03290412865070625b88ce46d8358b02da56f
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=30c03290
Add patches for Rust 1.84.1-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.84.1-fix-cross.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.84.1-fix-cross.patch | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
new file mode 100644
index 0000000..47d7766
--- /dev/null
+++ b/1.84.1-fix-cross.patch
@@ -0,0 +1,30 @@
+https://github.com/rust-lang/rust/issues/133629
+https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
+
+From: onur-ozkan <work@onurozkan.dev>
+Date: Thu, 30 Jan 2025 16:51:08 +0000
+Subject: [PATCH] set rustc dylib on manually constructed rustc command
+
+Signed-off-by: onur-ozkan <work@onurozkan.dev>
+--- a/src/bootstrap/src/core/builder/cargo.rs
++++ b/src/bootstrap/src/core/builder/cargo.rs
+@@ -653,7 +653,10 @@ impl Builder<'_> {
+ // Build proc macros both for the host and the target unless proc-macros are not
+ // supported by the target.
+ if target != compiler.host && cmd_kind != Kind::Check {
+- let error = command(self.rustc(compiler))
++ let mut rustc_cmd = command(self.rustc(compiler));
++ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
++
++ let error = rustc_cmd
+ .arg("--target")
+ .arg(target.rustc_target_arg())
+ .arg("--print=file-names")
+@@ -661,6 +664,7 @@ impl Builder<'_> {
+ .arg("-")
+ .run_capture(self)
+ .stderr();
++
+ let not_supported = error
+ .lines()
+ .any(|line| line.contains("unsupported crate type `proc-macro`"));
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 85532e155e4fb458a56d98b638eeb18e94528d49
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:10 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:10 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=85532e15
Add patches for Rust 1.87.0-r1
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.87.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 -----------------------------------------------------
1.87.0-znver.patch | 9 +++
2 files changed, 9 insertions(+), 180 deletions(-)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
deleted file mode 100644
index 634a50f..0000000
--- a/1.86.0-znver.patch
+++ /dev/null
@@ -1,180 +0,0 @@
-https://github.com/rust-lang/rust/issues/138054
-https://bugs.gentoo.org/953109#c7
---- a/library/portable-simd/crates/core_simd/src/lib.rs
-+++ b/library/portable-simd/crates/core_simd/src/lib.rs
-@@ -35,7 +35,11 @@
- feature(stdarch_x86_avx512)
- )]
- #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
--#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
-+#![deny(
-+ unsafe_op_in_unsafe_fn,
-+ unreachable_pub,
-+ clippy::undocumented_unsafe_blocks
-+)]
- #![doc(test(attr(deny(warnings))))]
- #![allow(internal_features)]
- #![unstable(feature = "portable_simd", issue = "86656")]
---- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-@@ -5,7 +5,7 @@ use core::marker::PhantomData;
-
- /// A mask where each lane is represented by a single bit.
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(
-+pub(crate) struct Mask<T, const N: usize>(
- <LaneCount<N> as SupportedLaneCount>::BitMask,
- PhantomData<T>,
- )
-@@ -78,7 +78,7 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- if value {
- mask.as_mut().fill(u8::MAX)
-@@ -93,12 +93,12 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- unsafe {
- self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
- }
-@@ -106,7 +106,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- unsafe {
- core::intrinsics::simd::simd_select_bitmask(
- self.0,
-@@ -118,19 +118,19 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
- }
-
- #[inline]
-- pub fn to_bitmask_integer(self) -> u64 {
-+ pub(crate) fn to_bitmask_integer(self) -> u64 {
- let mut bitmask = [0u8; 8];
- bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
- u64::from_ne_bytes(bitmask)
- }
-
- #[inline]
-- pub fn from_bitmask_integer(bitmask: u64) -> Self {
-+ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
- let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- let len = bytes.as_mut().len();
- bytes
-@@ -141,7 +141,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -151,13 +151,13 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- self != Self::splat(false)
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- self == Self::splat(true)
- }
- }
---- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-@@ -3,7 +3,7 @@
- use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
-
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(Simd<T, N>)
-+pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
- where
- T: MaskElement,
- LaneCount<N>: SupportedLaneCount;
-@@ -103,36 +103,36 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- T::eq(self.0[lane], T::TRUE)
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- self.0[lane] = if value { T::TRUE } else { T::FALSE }
- }
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- self.0
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- Self(value)
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -221,14 +221,14 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
- }
diff --git a/1.87.0-znver.patch b/1.87.0-znver.patch
new file mode 100644
index 0000000..11424a4
--- /dev/null
+++ b/1.87.0-znver.patch
@@ -0,0 +1,9 @@
+https://bugs.gentoo.org/956018#c3
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -1,4 +1,5 @@
+ #![allow(unused_imports)]
++#![allow(unused_attributes)]
+ use super::MaskElement;
+ use crate::simd::{LaneCount, Simd, SupportedLaneCount};
+ use core::marker::PhantomData;
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: 08796160f0525e99a9d550e8d2300cc0eac6785d
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=08796160
Add patches for Rust 1.85.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.78.0-musl-dynamic-linking.patch | 19 --
1.84.1-fix-cross.patch | 30 ---
...e-libz.patch => 1.85.0-cross-compile-libz.patch | 19 +-
1.85.0-musl-dynamic-linking.patch | 214 +++++++++++++++++++++
4 files changed, 227 insertions(+), 55 deletions(-)
diff --git a/1.78.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
deleted file mode 100644
index 25a281c..0000000
--- a/1.78.0-musl-dynamic-linking.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 2 Aug 2022 18:32:53 -0500
-Subject: [PATCH] Enable dynamic linking by default for musl
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/compiler/rustc_target/src/spec/base/linux_musl.rs
-+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
-@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
-
- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
-
- base
- }
---
-2.35.1
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
deleted file mode 100644
index 47d7766..0000000
--- a/1.84.1-fix-cross.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-https://github.com/rust-lang/rust/issues/133629
-https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
-
-From: onur-ozkan <work@onurozkan.dev>
-Date: Thu, 30 Jan 2025 16:51:08 +0000
-Subject: [PATCH] set rustc dylib on manually constructed rustc command
-
-Signed-off-by: onur-ozkan <work@onurozkan.dev>
---- a/src/bootstrap/src/core/builder/cargo.rs
-+++ b/src/bootstrap/src/core/builder/cargo.rs
-@@ -653,7 +653,10 @@ impl Builder<'_> {
- // Build proc macros both for the host and the target unless proc-macros are not
- // supported by the target.
- if target != compiler.host && cmd_kind != Kind::Check {
-- let error = command(self.rustc(compiler))
-+ let mut rustc_cmd = command(self.rustc(compiler));
-+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
-+
-+ let error = rustc_cmd
- .arg("--target")
- .arg(target.rustc_target_arg())
- .arg("--print=file-names")
-@@ -661,6 +664,7 @@ impl Builder<'_> {
- .arg("-")
- .run_capture(self)
- .stderr();
-+
- let not_supported = error
- .lines()
- .any(|line| line.contains("unsupported crate type `proc-macro`"));
diff --git a/1.83.0-cross-compile-libz.patch b/1.85.0-cross-compile-libz.patch
similarity index 50%
rename from 1.83.0-cross-compile-libz.patch
rename to 1.85.0-cross-compile-libz.patch
index 1eac04b..7bd45c4 100644
--- a/1.83.0-cross-compile-libz.patch
+++ b/1.85.0-cross-compile-libz.patch
@@ -1,19 +1,26 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+From 768f7e50a6d9a3db4e4eef45dcb4c56e9b580389 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <kangie@gentoo.org>
+Date: Sun, 9 Feb 2025 21:12:43 +1000
+Subject: [PATCH] Update libz cross-compile patch for 9999 (1.86.0)
+See-also: https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+See-also: https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -220,12 +220,7 @@
+@@ -219,13 +219,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--libs");
-
-- // Don't link system libs if cross-compiling unless targetting Windows.
+-
+- // Don't link system libs if cross-compiling unless targeting Windows.
- // On Windows system DLLs aren't linked directly, instead import libraries are used.
- // These import libraries are independent of the host.
- if !is_crossed || target.contains("windows") {
- cmd.arg("--system-libs");
- }
+ cmd.arg("--system-libs");
-
+
// We need libkstat for getHostCPUName on SPARC builds.
// See also: https://github.com/llvm/llvm-project/issues/64186
+--
+2.48.0
diff --git a/1.85.0-musl-dynamic-linking.patch b/1.85.0-musl-dynamic-linking.patch
new file mode 100644
index 0000000..e54cadf
--- /dev/null
+++ b/1.85.0-musl-dynamic-linking.patch
@@ -0,0 +1,214 @@
+From be965af5421e55c0032a989b220bc0da005d2272 Mon Sep 17 00:00:00 2001
+From: Michal Rostecki <vadorovsky@protonmail.com>
+Date: Tue, 25 Feb 2025 16:24:21 +0100
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs
+@@ -12,9 +12,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+-
+ Target {
+ llvm_target: "aarch64-unknown-linux-musl".into(),
+ metadata: crate::spec::TargetMetadata {
+--- 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 {
+ features: "+strict-align,+v6".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()
+ },
+ }
+--- 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 {
+ features: "+strict-align,+v6,+vfp2,-d32".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()
+ },
+ }
+--- 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 {
+ max_atomic_width: Some(32),
+ mcount: "\u{1}mcount".into(),
+ has_thumb_interworking: true,
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- crt_static_default: true,
++ crt_static_default: false,
+ ..base::linux_musl::opts()
+ },
+ }
+--- 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 {
+ features: "+v7,+thumb2,+soft-float,-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()
+ },
+ }
+--- 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 {
+ features: "+v7,+vfp3,-d32,+thumb2,-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()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs
+@@ -4,7 +4,5 @@ pub(crate) fn target() -> Target {
+ let mut base = super::i686_unknown_linux_musl::target();
+ base.cpu = "pentium".into();
+ base.llvm_target = "i586-unknown-linux-musl".into();
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ base
+ }
+--- a/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs
+@@ -6,8 +6,6 @@ pub(crate) fn target() -> Target {
+ base.max_atomic_width = Some(64);
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-melf_i386"]);
+ base.stack_probes = StackProbeType::Inline;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ // The unwinder used by i686-unknown-linux-musl, the LLVM libunwind
+ // implementation, apparently relies on frame pointers existing... somehow.
+--- a/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
++++ b/compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs
+@@ -22,8 +22,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,
+ ..base
+ },
+ }
+--- 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,6 @@ pub(crate) fn target() -> Target {
+ base.cpu = "mips64r2".into();
+ base.features = "+mips64r2".into();
+ base.max_atomic_width = Some(64);
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ Target {
+ // LLVM doesn't recognize "muslabi64" yet.
+ llvm_target: "mips64el-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs
+@@ -7,8 +7,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs
+@@ -6,8 +6,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64le-unknown-linux-musl".into(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs
+@@ -6,8 +6,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(),
+--- a/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
++++ b/compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs
+@@ -6,8 +6,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(),
+--- 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()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
++++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs
+@@ -12,8 +12,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(),
+--- 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()
+ },
+ }
+--- 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
+@@ -14,8 +14,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+ base.supports_xray = true;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ Target {
+ llvm_target: "x86_64-unknown-linux-musl".into(),
+--
+2.45.3
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 commit in: /
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
` (4 preceding siblings ...)
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
@ 2025-06-02 9:49 ` Matt Jolly
5 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-02 9:49 UTC (permalink / raw
To: gentoo-commits
commit: b5e7f08e06e0c888ca306ef0bdd71740fe4f6014
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 2 09:47:09 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Mon Jun 2 09:47:09 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=b5e7f08e
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 180 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 180 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..634a50f
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,180 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 464fd32ed05e175b359ca4ba05e2418095c125dd
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:38 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:38 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=464fd32e
Initial commit with README
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
README.rst | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/README.rst b/README.rst
new file mode 100644
index 0000000..9999e72
--- /dev/null
+++ b/README.rst
@@ -0,0 +1,24 @@
+###################
+Gentoo Rust Patches
+###################
+
+This repository contains patches required to build Rust on Gentoo Linux. These patches were previously
+part of the main Gentoo repository but have been moved here due to their size and to make maintenance easier.
+
+The patches are applied to the Rust source code during the build process. They address various issues such as
+compatibility with the Gentoo environment, specific compiler flags, and other adjustments needed for a successful build,
+or are backports to fix specific issues.
+
+Usage
+=====
+
+A branch will be created for each new Rust release (e.g. ``1.88``), and patches will be added to that branch as needed.
+
+Tags for ``${PV}`` will be created for each release, e.g. ``1.88.0``, ``1.88.1``, etc., to track the specific versions of
+Rust that these patches apply to. Revbumps will be tagged as required - if a patch is added or updated, a tag will be
+created for the new version (e.g. ``1.88.0-r1``).
+
+``master`` will contain patches required for ``nightly`` (live / ``9999``) ebuilds and will be updated as needed.
+
+To use the patches, you can clone this repository and apply the patches to the Rust source code before building
+(or use the Gentoo ebuild system which will handle this automatically!).
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 090ff7966c33e0ef08b2fb43dc245d98ccd04be6
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:38 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:38 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=090ff796
Add patches for Rust 1.74.1-r101
Patches:
- 1.62.1-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.62.1-musl-dynamic-linking.patch | 25 ++++++++++++++++
1.67.0-doc-wasm.patch | 34 ++++++++++++++++++++++
....0-ignore-broken-and-non-applicable-tests.patch | 30 +++++++++++++++++++
1.74.1-cross-compile-libz.patch | 17 +++++++++++
1.81.0-backport-bug937164.patch | 15 ++++++++++
1.81.0-backport-llvm-pr101761.patch | 30 +++++++++++++++++++
1.81.0-backport-llvm-pr101766.patch | 29 ++++++++++++++++++
7 files changed, 180 insertions(+)
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.62.1-musl-dynamic-linking.patch
new file mode 100644
index 0000000..fd56396
--- /dev/null
+++ b/1.62.1-musl-dynamic-linking.patch
@@ -0,0 +1,25 @@
+From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Tue, 2 Aug 2022 18:32:53 -0500
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ compiler/rustc_target/src/spec/linux_musl_base.rs | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
+index 207a87ab0..8a5a43363 100644
+--- a/compiler/rustc_target/src/spec/linux_musl_base.rs
++++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
+ 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.35.1
diff --git a/1.67.0-doc-wasm.patch b/1.67.0-doc-wasm.patch
new file mode 100644
index 0000000..06011de
--- /dev/null
+++ b/1.67.0-doc-wasm.patch
@@ -0,0 +1,34 @@
+From 92aa5f6b272bcdc020a34f8d90f9ef851b5b4504 Mon Sep 17 00:00:00 2001
+From: John Millikin <john@john-millikin.com>
+Date: Mon, 9 Jan 2023 13:54:21 +0900
+Subject: [PATCH] Disable `linux_ext` in wasm32 and fortanix rustdoc builds.
+
+The `std::os::unix` module is stubbed out when building docs for these
+target platforms. The introduction of Linux-specific extension traits
+caused `std::os::net` to depend on sub-modules of `std::os::unix`,
+which broke rustdoc for the `wasm32-unknown-unknown` target.
+
+Adding an additional `#[cfg]` guard solves that rustdoc failure by
+not declaring `linux_ext` on targets with a stubbed `std::os::unix`.
+---
+ library/std/src/os/net/mod.rs | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/library/std/src/os/net/mod.rs b/library/std/src/os/net/mod.rs
+index 5ec267c41e97c..b7046dd7c598c 100644
+--- a/library/std/src/os/net/mod.rs
++++ b/library/std/src/os/net/mod.rs
+@@ -1,4 +1,13 @@
+ //! OS-specific networking functionality.
+
++// See cfg macros in `library/std/src/os/mod.rs` for why these platforms must
++// be special-cased during rustdoc generation.
++#[cfg(not(all(
++ doc,
++ any(
++ all(target_arch = "wasm32", not(target_os = "wasi")),
++ all(target_vendor = "fortanix", target_env = "sgx")
++ )
++)))]
+ #[cfg(any(target_os = "linux", target_os = "android", doc))]
+ pub(super) mod linux_ext;
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.70.0-ignore-broken-and-non-applicable-tests.patch
new file mode 100644
index 0000000..2e12c78
--- /dev/null
+++ b/1.70.0-ignore-broken-and-non-applicable-tests.patch
@@ -0,0 +1,30 @@
+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
+---
+ test/ui/env-funky-keys.rs | 1 +
+ 6 files changed, 10 insertions(+)
+
+diff --git a/tests/ui/env-funky-keys.rs b/tests/ui/env-funky-keys.rs
+index c5c824ac58d..f3fe047a79c 100644
+--- a/tests/ui/env-funky-keys.rs
++++ b/tests/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/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
new file mode 100644
index 0000000..98cec09
--- /dev/null
+++ b/1.74.1-cross-compile-libz.patch
@@ -0,0 +1,17 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -237,10 +237,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+-
+- if !is_crossed {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ if (target.starts_with("arm") && !target.contains("freebsd"))
+ || target.starts_with("mips-")
diff --git a/1.81.0-backport-bug937164.patch b/1.81.0-backport-bug937164.patch
new file mode 100644
index 0000000..a6e887d
--- /dev/null
+++ b/1.81.0-backport-bug937164.patch
@@ -0,0 +1,15 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+
+Unnecessary on 19+ because 2222fddfc0a2ff02036542511597839856289094 adds
+SmallVector and SmallVector is fixed by another patch.
+--- a/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
++++ b/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
+@@ -13,6 +13,7 @@
+ #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+ #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+ #include <string>
+
diff --git a/1.81.0-backport-llvm-pr101761.patch b/1.81.0-backport-llvm-pr101761.patch
new file mode 100644
index 0000000..fccb22d
--- /dev/null
+++ b/1.81.0-backport-llvm-pr101761.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+https://github.com/llvm/llvm-project/commit/7e44305041d96b064c197216b931ae3917a34ac1
+https://github.com/llvm/llvm-project/pull/101761
+
+From 7e44305041d96b064c197216b931ae3917a34ac1 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 23:07:21 +0100
+Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
+
+SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0]
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+---
+ src/llvm-project/llvm/include/llvm/ADT/SmallVector.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
+index 09676d792dfebd..17444147b102a9 100644
+--- a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
++++ b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
+@@ -19,6 +19,7 @@
+ #include <algorithm>
+ #include <cassert>
+ #include <cstddef>
++#include <cstdint>
+ #include <cstdlib>
+ #include <cstring>
+ #include <functional>
diff --git a/1.81.0-backport-llvm-pr101766.patch b/1.81.0-backport-llvm-pr101766.patch
new file mode 100644
index 0000000..fdecdaf
--- /dev/null
+++ b/1.81.0-backport-llvm-pr101766.patch
@@ -0,0 +1,29 @@
+https://bugs.gentoo.org/937525
+https://bugs.gentoo.org/937164
+https://github.com/llvm/llvm-project/pull/101766
+
+From 5b69d0cf697f0d78406a5a7ed18eaa4f57a0580a Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Fri, 2 Aug 2024 23:38:55 +0100
+Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
+
+createAMDGPUELFObjectWriter uses `uint8_t` without including `<cstdint>`
+which fails to build w/ GCC 15 after a change in libstdc++ [0].
+
+[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
+---
+ src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+index 3ef00f75735b0d..879dbe1b279b18 100644
+--- a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
++++ b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
+@@ -15,6 +15,7 @@
+ #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+ #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
+
++#include <cstdint>
+ #include <memory>
+
+ namespace llvm {
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: fbb876447e7ac1f204e7a1687507d2753ce59628
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=fbb87644
Add patches for Rust 1.75.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 45 ++++++++++++++++++++++
...king.patch => 1.75.0-musl-dynamic-linking.patch | 10 +----
2 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
new file mode 100644
index 0000000..c68ceba
--- /dev/null
+++ b/1.75.0-handle-vendored-sources.patch
@@ -0,0 +1,45 @@
+From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
+From: Arlo Siemsen <arsiem@microsoft.com>
+Date: Thu, 4 Jan 2024 11:40:56 -0600
+Subject: [PATCH] Handle vendored sources when remapping paths
+
+Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
+---
+ src/bootstrap/src/core/builder.rs | 19 ++++++++++++-------
+ 1 file changed, 12 insertions(+), 7 deletions(-)
+
+diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
+index 4e20babc55a..3770d0687b2 100644
+--- a/src/bootstrap/src/core/builder.rs
++++ b/src/bootstrap/src/core/builder.rs
+@@ -1799,15 +1799,20 @@ pub fn cargo(
+ }
+
+ if self.config.rust_remap_debuginfo {
+- // FIXME: handle vendored sources
+- let registry_src = t!(home::cargo_home()).join("registry").join("src");
+ let mut env_var = OsString::new();
+- for entry in t!(std::fs::read_dir(registry_src)) {
+- if !env_var.is_empty() {
+- env_var.push("\t");
+- }
+- env_var.push(t!(entry).path());
++ if self.config.vendor {
++ let vendor = self.build.src.join("vendor");
++ env_var.push(vendor);
+ env_var.push("=/rust/deps");
++ } else {
++ let registry_src = t!(home::cargo_home()).join("registry").join("src");
++ for entry in t!(std::fs::read_dir(registry_src)) {
++ if !env_var.is_empty() {
++ env_var.push("\t");
++ }
++ env_var.push(t!(entry).path());
++ env_var.push("=/rust/deps");
++ }
+ }
+ cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
+ }
+--
+2.43.0
+
diff --git a/1.62.1-musl-dynamic-linking.patch b/1.75.0-musl-dynamic-linking.patch
similarity index 58%
rename from 1.62.1-musl-dynamic-linking.patch
rename to 1.75.0-musl-dynamic-linking.patch
index fd56396..7dc34f8 100644
--- a/1.62.1-musl-dynamic-linking.patch
+++ b/1.75.0-musl-dynamic-linking.patch
@@ -4,14 +4,8 @@ Date: Tue, 2 Aug 2022 18:32:53 -0500
Subject: [PATCH] Enable dynamic linking by default for musl
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
----
- compiler/rustc_target/src/spec/linux_musl_base.rs | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/compiler/rustc_target/src/spec/linux_musl_base.rs b/compiler/rustc_target/src/spec/linux_musl_base.rs
-index 207a87ab0..8a5a43363 100644
---- a/compiler/rustc_target/src/spec/linux_musl_base.rs
-+++ b/compiler/rustc_target/src/spec/linux_musl_base.rs
+--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
++++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 393b2e904eeb04515d75f24a948aa26f16098529
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=393b2e90
Add patches for Rust 1.76.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
new file mode 100644
index 0000000..02bfeca
--- /dev/null
+++ b/1.76.0-loong-code-model.patch
@@ -0,0 +1,73 @@
+https://github.com/rust-lang/rust/pull/120661
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Mon, 5 Feb 2024 13:18:32 +0800
+Subject: [PATCH] target: default to the medium code model on LoongArch targets
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Rust LoongArch targets have been using the default LLVM code model
+so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
+As described in the "Code Model" section of LoongArch ELF psABI spec
+v20231219 [1], one can only make function calls as far as ±128MiB with
+the "normal" code model; this is insufficient for very large software
+containing Rust components that needs to be linked into the big text
+section, such as Chromium.
+
+Because:
+
+* we do not want to ask users to recompile std if they are to build
+ such software,
+* objects compiled with larger code models can be linked with those
+ with smaller code models without problems, and
+* the "medium" code model is comparable to the "small"/"normal" one
+ performance-wise (same data access pattern; each function call
+ becomes 2-insn long and indirect, but this may be relaxed back into
+ the direct 1-insn form in a future LLVM version), but is able to
+ perform function calls within ±128GiB,
+
+it is better to just switch the targets to the "medium" code model,
+which is also "medium" in LLVM-speak.
+
+[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
+@@ -1,4 +1,4 @@
+-use crate::spec::{base, Target, TargetOptions};
++use crate::spec::{base, CodeModel, Target, TargetOptions};
+
+ pub fn target() -> Target {
+ Target {
+@@ -7,6 +7,7 @@ pub fn target() -> Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
+ arch: "loongarch64".into(),
+ options: TargetOptions {
++ code_model: Some(CodeModel::Medium),
+ cpu: "generic".into(),
+ features: "+f,+d".into(),
+ llvm_abiname: "lp64d".into(),
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+@@ -16,7 +16,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
+@@ -17,7 +17,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--
+2.43.0
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: cfb7ecd30d8df18659f1767cb09f005d011b5ba1
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=cfb7ecd3
Add patches for Rust 1.77.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.75.0-handle-vendored-sources.patch | 45 ------------------------------------
1 file changed, 45 deletions(-)
diff --git a/1.75.0-handle-vendored-sources.patch b/1.75.0-handle-vendored-sources.patch
deleted file mode 100644
index c68ceba..0000000
--- a/1.75.0-handle-vendored-sources.patch
+++ /dev/null
@@ -1,45 +0,0 @@
-From 4b7e0a0b56aa2446e670dfd6558380a1039a86aa Mon Sep 17 00:00:00 2001
-From: Arlo Siemsen <arsiem@microsoft.com>
-Date: Thu, 4 Jan 2024 11:40:56 -0600
-Subject: [PATCH] Handle vendored sources when remapping paths
-
-Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
----
- src/bootstrap/src/core/builder.rs | 19 ++++++++++++-------
- 1 file changed, 12 insertions(+), 7 deletions(-)
-
-diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
-index 4e20babc55a..3770d0687b2 100644
---- a/src/bootstrap/src/core/builder.rs
-+++ b/src/bootstrap/src/core/builder.rs
-@@ -1799,15 +1799,20 @@ pub fn cargo(
- }
-
- if self.config.rust_remap_debuginfo {
-- // FIXME: handle vendored sources
-- let registry_src = t!(home::cargo_home()).join("registry").join("src");
- let mut env_var = OsString::new();
-- for entry in t!(std::fs::read_dir(registry_src)) {
-- if !env_var.is_empty() {
-- env_var.push("\t");
-- }
-- env_var.push(t!(entry).path());
-+ if self.config.vendor {
-+ let vendor = self.build.src.join("vendor");
-+ env_var.push(vendor);
- env_var.push("=/rust/deps");
-+ } else {
-+ let registry_src = t!(home::cargo_home()).join("registry").join("src");
-+ for entry in t!(std::fs::read_dir(registry_src)) {
-+ if !env_var.is_empty() {
-+ env_var.push("\t");
-+ }
-+ env_var.push(t!(entry).path());
-+ env_var.push("=/rust/deps");
-+ }
- }
- cargo.env("RUSTC_CARGO_REGISTRY_SRC_TO_REMAP", env_var);
- }
---
-2.43.0
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: df4b25f466eece5a5fc2610863942c8e2560ecb6
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=df4b25f4
Add patches for Rust 1.78.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.78.0-ignore-broken-and-non-applicable-tests.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 ----------------------
....0-ignore-broken-and-non-applicable-tests.patch | 12 ++--
...king.patch => 1.78.0-musl-dynamic-linking.patch | 2 +-
1.79.0-revert-8c40426.patch | 18 ++++++
4 files changed, 25 insertions(+), 80 deletions(-)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
deleted file mode 100644
index 02bfeca..0000000
--- a/1.76.0-loong-code-model.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-https://github.com/rust-lang/rust/pull/120661
-From: WANG Xuerui <xen0n@gentoo.org>
-Date: Mon, 5 Feb 2024 13:18:32 +0800
-Subject: [PATCH] target: default to the medium code model on LoongArch targets
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-The Rust LoongArch targets have been using the default LLVM code model
-so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
-As described in the "Code Model" section of LoongArch ELF psABI spec
-v20231219 [1], one can only make function calls as far as ±128MiB with
-the "normal" code model; this is insufficient for very large software
-containing Rust components that needs to be linked into the big text
-section, such as Chromium.
-
-Because:
-
-* we do not want to ask users to recompile std if they are to build
- such software,
-* objects compiled with larger code models can be linked with those
- with smaller code models without problems, and
-* the "medium" code model is comparable to the "small"/"normal" one
- performance-wise (same data access pattern; each function call
- becomes 2-insn long and indirect, but this may be relaxed back into
- the direct 1-insn form in a future LLVM version), but is able to
- perform function calls within ±128GiB,
-
-it is better to just switch the targets to the "medium" code model,
-which is also "medium" in LLVM-speak.
-
-[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
-@@ -1,4 +1,4 @@
--use crate::spec::{base, Target, TargetOptions};
-+use crate::spec::{base, CodeModel, Target, TargetOptions};
-
- pub fn target() -> Target {
- Target {
-@@ -7,6 +7,7 @@ pub fn target() -> Target {
- data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
- arch: "loongarch64".into(),
- options: TargetOptions {
-+ code_model: Some(CodeModel::Medium),
- cpu: "generic".into(),
- features: "+f,+d".into(),
- llvm_abiname: "lp64d".into(),
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
-@@ -16,7 +16,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-+++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
-@@ -17,7 +17,7 @@ pub fn target() -> Target {
- max_atomic_width: Some(64),
- relocation_model: RelocModel::Static,
- panic_strategy: PanicStrategy::Abort,
-- code_model: Some(CodeModel::Small),
-+ code_model: Some(CodeModel::Medium),
- ..Default::default()
- },
- }
---
-2.43.0
-
diff --git a/1.70.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
similarity index 84%
rename from 1.70.0-ignore-broken-and-non-applicable-tests.patch
rename to 1.78.0-ignore-broken-and-non-applicable-tests.patch
index 2e12c78..610e5d0 100644
--- a/1.70.0-ignore-broken-and-non-applicable-tests.patch
+++ b/1.78.0-ignore-broken-and-non-applicable-tests.patch
@@ -18,13 +18,13 @@ index c5c824ac58d..f3fe047a79c 100644
--- a/tests/ui/env-funky-keys.rs
+++ b/tests/ui/env-funky-keys.rs
@@ -1,6 +1,7 @@
- // run-pass
- // Ignore this test on Android, because it segfaults there.
+ //@ run-pass
+ //@ Ignore this test on Android, because it segfaults there.
-+// ignore-test
- // ignore-android
- // ignore-windows
- // ignore-cloudabi no execve
++//@ ignore-test
+ //@ ignore-android
+ //@ ignore-windows
+ //@ ignore-cloudabi no execve
--
2.24.1
diff --git a/1.75.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
similarity index 88%
rename from 1.75.0-musl-dynamic-linking.patch
rename to 1.78.0-musl-dynamic-linking.patch
index 7dc34f8..25a281c 100644
--- a/1.75.0-musl-dynamic-linking.patch
+++ b/1.78.0-musl-dynamic-linking.patch
@@ -7,7 +7,7 @@ Signed-off-by: Jory Pratt <anarchy@gentoo.org>
--- a/compiler/rustc_target/src/spec/base/linux_musl.rs
+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.crt_objects_fallback = Some(CrtObjectsFallback::Musl);
+ base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
// These targets statically link libc by default
- base.crt_static_default = true;
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
new file mode 100644
index 0000000..583f400
--- /dev/null
+++ b/1.79.0-revert-8c40426.patch
@@ -0,0 +1,18 @@
+This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
+
+https://bugs.gentoo.org/933382
+
+diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
+index d4473e24039..58f351d17fa 100644
+--- a/src/bootstrap/src/core/build_steps/llvm.rs
++++ b/src/bootstrap/src/core/build_steps/llvm.rs
+@@ -724,8 +724,7 @@ fn configure_cmake(
+ }
+ }
+ cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
+- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
+- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
++ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
+ }
+
+ cfg.build_arg("-j").build_arg(builder.jobs().to_string());
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 4c3b3e1257c8b4ccb8ce1b9770179326ce8093a4
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=4c3b3e12
Add patches for Rust 1.80.1-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.79.0-revert-8c40426.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
....0-ignore-broken-and-non-applicable-tests.patch | 30 ----------------------
1 file changed, 30 deletions(-)
diff --git a/1.78.0-ignore-broken-and-non-applicable-tests.patch b/1.78.0-ignore-broken-and-non-applicable-tests.patch
deleted file mode 100644
index 610e5d0..0000000
--- a/1.78.0-ignore-broken-and-non-applicable-tests.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-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
----
- test/ui/env-funky-keys.rs | 1 +
- 6 files changed, 10 insertions(+)
-
-diff --git a/tests/ui/env-funky-keys.rs b/tests/ui/env-funky-keys.rs
-index c5c824ac58d..f3fe047a79c 100644
---- a/tests/ui/env-funky-keys.rs
-+++ b/tests/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
-
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 90415e67fa403895ce00294f9e7270f29a13913c
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=90415e67
Add patches for Rust 1.83.0-r3
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.83.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.74.1-cross-compile-libz.patch | 17 -----------------
1.83.0-cross-compile-libz.patch | 21 +++++++++++++++++++++
...rtion.patch => 1.83.0-dwarf-llvm-assertion.patch | 7 +------
3 files changed, 22 insertions(+), 23 deletions(-)
diff --git a/1.74.1-cross-compile-libz.patch b/1.74.1-cross-compile-libz.patch
deleted file mode 100644
index 98cec09..0000000
--- a/1.74.1-cross-compile-libz.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
-
---- a/compiler/rustc_llvm/build.rs
-+++ b/compiler/rustc_llvm/build.rs
-@@ -237,10 +237,7 @@ fn main() {
- // of llvm-config, not the target that we're attempting to link.
- let mut cmd = Command::new(&llvm_config);
- cmd.arg(llvm_link_arg).arg("--libs");
--
-- if !is_crossed {
-- cmd.arg("--system-libs");
-- }
-+ cmd.arg("--system-libs");
-
- if (target.starts_with("arm") && !target.contains("freebsd"))
- || target.starts_with("mips-")
diff --git a/1.83.0-cross-compile-libz.patch b/1.83.0-cross-compile-libz.patch
new file mode 100644
index 0000000..12844fd
--- /dev/null
+++ b/1.83.0-cross-compile-libz.patch
@@ -0,0 +1,21 @@
+https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+
+diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
+index f606fa483ca..8a2e1c40e8b 100644
+--- a/compiler/rustc_llvm/build.rs
++++ b/compiler/rustc_llvm/build.rs
+@@ -220,12 +220,7 @@
+ let mut cmd = Command::new(&llvm_config);
+ cmd.arg(llvm_link_arg).arg("--libs");
+
+- // Don't link system libs if cross-compiling unless targetting Windows.
+- // On Windows system DLLs aren't linked directly, instead import libraries are used.
+- // These import libraries are independent of the host.
+- if !is_crossed || target.contains("windows") {
+- cmd.arg("--system-libs");
+- }
++ cmd.arg("--system-libs");
+
+ // We need libkstat for getHostCPUName on SPARC builds.
+ // See also: https://github.com/llvm/llvm-project/issues/64186
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
similarity index 98%
rename from 1.82.0-dwarf-llvm-assertion.patch
rename to 1.83.0-dwarf-llvm-assertion.patch
index 8c99c9a..64d00ac 100644
--- a/1.82.0-dwarf-llvm-assertion.patch
+++ b/1.83.0-dwarf-llvm-assertion.patch
@@ -1,8 +1,3 @@
-https://bugs.gentoo.org/942013
-https://bugs.gentoo.org/942884
-https://github.com/rust-lang/rust/issues/131944
-https://github.com/rust-lang/rust/pull/132613
-
From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
From: Kyle Huey <khuey@kylehuey.com>
Date: Mon, 4 Nov 2024 11:38:14 -0800
@@ -38,8 +33,8 @@ index ac6c2fb1b83a6..0f1909486ec7e 100644
use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
use rustc_codegen_ssa::traits::*;
+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::bit_set::BitSet;
use rustc_index::Idx;
+ use rustc_index::bit_set::BitSet;
use rustc_middle::mir::{Body, SourceScope};
use rustc_middle::ty::layout::FnAbiOf;
use rustc_middle::ty::{self, Instance};
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: c15afcd8f6cf3448e43b360d1b3d85b228c1c3cb
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=c15afcd8
Add patches for Rust 1.82.0-r103
Patches:
- 1.67.0-doc-wasm.patch
- 1.74.1-cross-compile-libz.patch
- 1.78.0-musl-dynamic-linking.patch
- 1.82.0-dwarf-llvm-assertion.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.79.0-revert-8c40426.patch | 18 ---
1.81.0-backport-bug937164.patch | 15 ---
1.81.0-backport-llvm-pr101761.patch | 30 -----
1.81.0-backport-llvm-pr101766.patch | 29 -----
1.82.0-dwarf-llvm-assertion.patch | 247 ++++++++++++++++++++++++++++++++++++
5 files changed, 247 insertions(+), 92 deletions(-)
diff --git a/1.79.0-revert-8c40426.patch b/1.79.0-revert-8c40426.patch
deleted file mode 100644
index 583f400..0000000
--- a/1.79.0-revert-8c40426.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-This reverts commit 8c40426051a667673cdac9975f84cb6acd4e245f.
-
-https://bugs.gentoo.org/933382
-
-diff --git a/src/bootstrap/src/core/build_steps/llvm.rs b/src/bootstrap/src/core/build_steps/llvm.rs
-index d4473e24039..58f351d17fa 100644
---- a/src/bootstrap/src/core/build_steps/llvm.rs
-+++ b/src/bootstrap/src/core/build_steps/llvm.rs
-@@ -724,8 +724,7 @@ fn configure_cmake(
- }
- }
- cfg.define("CMAKE_C_COMPILER", sanitize_cc(&cc))
-- .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx))
-- .define("CMAKE_ASM_COMPILER", sanitize_cc(&cc));
-+ .define("CMAKE_CXX_COMPILER", sanitize_cc(&cxx));
- }
-
- cfg.build_arg("-j").build_arg(builder.jobs().to_string());
diff --git a/1.81.0-backport-bug937164.patch b/1.81.0-backport-bug937164.patch
deleted file mode 100644
index a6e887d..0000000
--- a/1.81.0-backport-bug937164.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-
-Unnecessary on 19+ because 2222fddfc0a2ff02036542511597839856289094 adds
-SmallVector and SmallVector is fixed by another patch.
---- a/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
-+++ b/src/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h
-@@ -13,6 +13,7 @@
- #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
- #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86MCTARGETDESC_H
-
-+#include <cstdint>
- #include <memory>
- #include <string>
-
diff --git a/1.81.0-backport-llvm-pr101761.patch b/1.81.0-backport-llvm-pr101761.patch
deleted file mode 100644
index fccb22d..0000000
--- a/1.81.0-backport-llvm-pr101761.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-https://github.com/llvm/llvm-project/commit/7e44305041d96b064c197216b931ae3917a34ac1
-https://github.com/llvm/llvm-project/pull/101761
-
-From 7e44305041d96b064c197216b931ae3917a34ac1 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 23:07:21 +0100
-Subject: [PATCH] [ADT] Add `<cstdint>` to SmallVector (#101761)
-
-SmallVector uses `uint32_t`, `uint64_t` without including `<cstdint>`
-which fails to build w/ GCC 15 after a change in libstdc++ [0]
-
-[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
----
- src/llvm-project/llvm/include/llvm/ADT/SmallVector.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
-index 09676d792dfebd..17444147b102a9 100644
---- a/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
-+++ b/src/llvm-project/llvm/include/llvm/ADT/SmallVector.h
-@@ -19,6 +19,7 @@
- #include <algorithm>
- #include <cassert>
- #include <cstddef>
-+#include <cstdint>
- #include <cstdlib>
- #include <cstring>
- #include <functional>
diff --git a/1.81.0-backport-llvm-pr101766.patch b/1.81.0-backport-llvm-pr101766.patch
deleted file mode 100644
index fdecdaf..0000000
--- a/1.81.0-backport-llvm-pr101766.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-https://bugs.gentoo.org/937525
-https://bugs.gentoo.org/937164
-https://github.com/llvm/llvm-project/pull/101766
-
-From 5b69d0cf697f0d78406a5a7ed18eaa4f57a0580a Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Fri, 2 Aug 2024 23:38:55 +0100
-Subject: [PATCH] [AMDGPU] Include `<cstdint>` in AMDGPUMCTargetDesc
-
-createAMDGPUELFObjectWriter uses `uint8_t` without including `<cstdint>`
-which fails to build w/ GCC 15 after a change in libstdc++ [0].
-
-[0] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=3a817a4a5a6d94da9127af3be9f84a74e3076ee2
----
- src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
-index 3ef00f75735b0d..879dbe1b279b18 100644
---- a/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
-+++ b/src/llvm-project/llvm/lib/Target/AMDGPU/MCTargetDesc/AMDGPUMCTargetDesc.h
-@@ -15,6 +15,7 @@
- #ifndef LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
- #define LLVM_LIB_TARGET_AMDGPU_MCTARGETDESC_AMDGPUMCTARGETDESC_H
-
-+#include <cstdint>
- #include <memory>
-
- namespace llvm {
diff --git a/1.82.0-dwarf-llvm-assertion.patch b/1.82.0-dwarf-llvm-assertion.patch
new file mode 100644
index 0000000..8c99c9a
--- /dev/null
+++ b/1.82.0-dwarf-llvm-assertion.patch
@@ -0,0 +1,247 @@
+https://bugs.gentoo.org/942013
+https://bugs.gentoo.org/942884
+https://github.com/rust-lang/rust/issues/131944
+https://github.com/rust-lang/rust/pull/132613
+
+From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
+From: Kyle Huey <khuey@kylehuey.com>
+Date: Mon, 4 Nov 2024 11:38:14 -0800
+Subject: [PATCH] Add discriminators to DILocations when multiple functions are
+ inlined into a single point.
+
+LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
+location with different values. proc-macros make it possible for arbitrary code,
+including multiple calls that get inlined, to happen at any given location in the source
+code. Add discriminators when that happens so these locations are different to LLVM.
+
+This may interfere with the AddDiscriminators pass in LLVM, which is added by the
+unstable flag -Zdebug-info-for-profiling.
+
+Fixes #131944
+---
+ .../src/debuginfo/create_scope_map.rs | 60 ++++++++++++++++++-
+ compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 4 ++
+ .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 8 +++
+ .../auxiliary/macro_def.rs | 11 ++++
+ .../mir_inlined_twice_var_locs.rs | 53 ++++++++++++++++
+ 5 files changed, 133 insertions(+), 3 deletions(-)
+ create mode 100644 tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
+ create mode 100644 tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
+
+diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
+index ac6c2fb1b83a6..0f1909486ec7e 100644
+--- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
++++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
+@@ -1,11 +1,15 @@
++use std::collections::hash_map::Entry;
++
+ use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
+ use rustc_codegen_ssa::traits::*;
++use rustc_data_structures::fx::FxHashMap;
+ use rustc_index::bit_set::BitSet;
+ use rustc_index::Idx;
+ use rustc_middle::mir::{Body, SourceScope};
+ use rustc_middle::ty::layout::FnAbiOf;
+ use rustc_middle::ty::{self, Instance};
+ use rustc_session::config::DebugInfo;
++use rustc_span::BytePos;
+
+ use super::metadata::file_metadata;
+ use super::utils::DIB;
+@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
+ None
+ };
+ let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
++ let mut discriminators = FxHashMap::default();
+ // Instantiate all scopes.
+ for idx in 0..mir.source_scopes.len() {
+ let scope = SourceScope::new(idx);
+- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ &variables,
++ debug_context,
++ &mut instantiated,
++ &mut discriminators,
++ scope,
++ );
+ }
+ assert!(instantiated.count() == mir.source_scopes.len());
+ }
+@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
+ variables: &Option<BitSet<SourceScope>>,
+ debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
+ instantiated: &mut BitSet<SourceScope>,
++ discriminators: &mut FxHashMap<BytePos, u32>,
+ scope: SourceScope,
+ ) {
+ if instantiated.contains(scope) {
+@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
+
+ let scope_data = &mir.source_scopes[scope];
+ let parent_scope = if let Some(parent) = scope_data.parent_scope {
+- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
++ make_mir_scope(
++ cx,
++ instance,
++ mir,
++ variables,
++ debug_context,
++ instantiated,
++ discriminators,
++ parent,
++ );
+ debug_context.scopes[parent]
+ } else {
+ // The root is the function itself.
+@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
+ // FIXME(eddyb) this doesn't account for the macro-related
+ // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
+ let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
+- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
++ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
++
++ // NB: In order to produce proper debug info for variables (particularly
++ // arguments) in multiply-inline functions, LLVM expects to see a single
++ // DILocalVariable with multiple different DILocations in the IR. While
++ // the source information for each DILocation would be identical, their
++ // inlinedAt attributes will be unique to the particular callsite.
++ //
++ // We generate DILocations here based on the callsite's location in the
++ // source code. A single location in the source code usually can't
++ // produce multiple distinct calls so this mostly works, until
++ // proc-macros get involved. A proc-macro can generate multiple calls
++ // at the same span, which breaks the assumption that we're going to
++ // produce a unique DILocation for every scope we process here. We
++ // have to explicitly add discriminators if we see inlines into the
++ // same source code location.
++ //
++ // Note further that we can't key this hashtable on the span itself,
++ // because these spans could have distinct SyntaxContexts. We have
++ // to key on exactly what we're giving to LLVM.
++ match discriminators.entry(callsite_span.lo()) {
++ Entry::Occupied(mut o) => {
++ *o.get_mut() += 1;
++ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
++ .expect("Failed to encode discriminator in DILocation")
++ }
++ Entry::Vacant(v) => {
++ v.insert(0);
++ loc
++ }
++ }
+ });
+
+ debug_context.scopes[scope] = DebugScope {
+diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+index 3d2e270a3868e..75a5ec44c2285 100644
+--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
++++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
+@@ -2174,6 +2174,10 @@ unsafe extern "C" {
+ Scope: &'a DIScope,
+ InlinedAt: Option<&'a DILocation>,
+ ) -> &'a DILocation;
++ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
++ Location: &'a DILocation,
++ BD: c_uint,
++ ) -> Option<&'a DILocation>;
+ pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
+ pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
+diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+index 9330c83b7f230..cd70c3f266920 100644
+--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
++++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
+@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
+ return wrap(Loc);
+ }
+
++extern "C" LLVMMetadataRef
++LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
++ unsigned BD) {
++ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
++ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
++ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
++}
++
+ extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
+ return dwarf::DW_OP_deref;
+ }
+diff --git a/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
+new file mode 100644
+index 0000000000000..159ecfd09743d
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
+@@ -0,0 +1,11 @@
++//@ force-host
++//@ no-prefer-dynamic
++#![crate_type = "proc-macro"]
++
++extern crate proc_macro;
++use proc_macro::*;
++
++#[proc_macro]
++pub fn square_twice(_item: TokenStream) -> TokenStream {
++ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
++}
+diff --git a/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
+new file mode 100644
+index 0000000000000..c3858044c0c9f
+--- /dev/null
++++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
+@@ -0,0 +1,53 @@
++//@ min-llvm-version: 19
++//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
++// MSVC is different because of the individual allocas.
++//@ ignore-msvc
++
++//@ aux-build:macro_def.rs
++
++// Find the variable.
++// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
++
++// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
++// backwards.
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
++// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
++
++// Find the first location definition, looking forwards again.
++// CHECK: ![[#var_loc1]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
++
++// Find the first location's inlinedAt
++// NB: If we fail here it's *probably* because we failed to produce two
++// different locations and ended up reusing an earlier one.
++// CHECK: ![[#var_inlinedAt1]] = !DILocation
++// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
++
++// Find the second location definition, still looking forwards.
++// NB: If we failed to produce two different locations, the test will
++// definitely fail by this point (if it hasn't already) because we won't
++// be able to find the same line again.
++// CHECK: ![[#var_loc2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
++
++// Find the second location's inlinedAt.
++// CHECK: ![[#var_inlinedAt2]] = !DILocation
++// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
++
++// Finally, check that a discriminator was emitted for the second scope.
++// FIXMEkhuey ideally we would check that *either* scope has a discriminator
++// but I don't know that it's possible to check that with FileCheck.
++// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
++// CHECK-SAME: discriminator: [[#]]
++extern crate macro_def;
++
++use std::env;
++
++fn square(n: i32) -> i32 {
++ n * n
++}
++
++fn main() {
++ let (z1, z2) = macro_def::square_twice!();
++ println!("{z1} == {z2}");
++}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: cfc5e86bfed8aea6cceb719180725b8990e6fe71
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=cfc5e86b
Add patches for Rust 1.84.0-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.83.0-dwarf-llvm-assertion.patch | 242 --------------------------------------
1 file changed, 242 deletions(-)
diff --git a/1.83.0-dwarf-llvm-assertion.patch b/1.83.0-dwarf-llvm-assertion.patch
deleted file mode 100644
index 64d00ac..0000000
--- a/1.83.0-dwarf-llvm-assertion.patch
+++ /dev/null
@@ -1,242 +0,0 @@
-From 1dc106121b62562ead6e7d612fa136dc4b35cd5d Mon Sep 17 00:00:00 2001
-From: Kyle Huey <khuey@kylehuey.com>
-Date: Mon, 4 Nov 2024 11:38:14 -0800
-Subject: [PATCH] Add discriminators to DILocations when multiple functions are
- inlined into a single point.
-
-LLVM does not expect to ever see multiple dbg_declares for the same variable at the same
-location with different values. proc-macros make it possible for arbitrary code,
-including multiple calls that get inlined, to happen at any given location in the source
-code. Add discriminators when that happens so these locations are different to LLVM.
-
-This may interfere with the AddDiscriminators pass in LLVM, which is added by the
-unstable flag -Zdebug-info-for-profiling.
-
-Fixes #131944
----
- .../src/debuginfo/create_scope_map.rs | 60 ++++++++++++++++++-
- compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 4 ++
- .../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 8 +++
- .../auxiliary/macro_def.rs | 11 ++++
- .../mir_inlined_twice_var_locs.rs | 53 ++++++++++++++++
- 5 files changed, 133 insertions(+), 3 deletions(-)
- create mode 100644 tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
- create mode 100644 tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
-
-diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-index ac6c2fb1b83a6..0f1909486ec7e 100644
---- a/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-+++ b/compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs
-@@ -1,11 +1,15 @@
-+use std::collections::hash_map::Entry;
-+
- use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext};
- use rustc_codegen_ssa::traits::*;
-+use rustc_data_structures::fx::FxHashMap;
- use rustc_index::Idx;
- use rustc_index::bit_set::BitSet;
- use rustc_middle::mir::{Body, SourceScope};
- use rustc_middle::ty::layout::FnAbiOf;
- use rustc_middle::ty::{self, Instance};
- use rustc_session::config::DebugInfo;
-+use rustc_span::BytePos;
-
- use super::metadata::file_metadata;
- use super::utils::DIB;
-@@ -37,10 +41,20 @@ pub(crate) fn compute_mir_scopes<'ll, 'tcx>(
- None
- };
- let mut instantiated = BitSet::new_empty(mir.source_scopes.len());
-+ let mut discriminators = FxHashMap::default();
- // Instantiate all scopes.
- for idx in 0..mir.source_scopes.len() {
- let scope = SourceScope::new(idx);
-- make_mir_scope(cx, instance, mir, &variables, debug_context, &mut instantiated, scope);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ &variables,
-+ debug_context,
-+ &mut instantiated,
-+ &mut discriminators,
-+ scope,
-+ );
- }
- assert!(instantiated.count() == mir.source_scopes.len());
- }
-@@ -52,6 +66,7 @@ fn make_mir_scope<'ll, 'tcx>(
- variables: &Option<BitSet<SourceScope>>,
- debug_context: &mut FunctionDebugContext<'tcx, &'ll DIScope, &'ll DILocation>,
- instantiated: &mut BitSet<SourceScope>,
-+ discriminators: &mut FxHashMap<BytePos, u32>,
- scope: SourceScope,
- ) {
- if instantiated.contains(scope) {
-@@ -60,7 +75,16 @@ fn make_mir_scope<'ll, 'tcx>(
-
- let scope_data = &mir.source_scopes[scope];
- let parent_scope = if let Some(parent) = scope_data.parent_scope {
-- make_mir_scope(cx, instance, mir, variables, debug_context, instantiated, parent);
-+ make_mir_scope(
-+ cx,
-+ instance,
-+ mir,
-+ variables,
-+ debug_context,
-+ instantiated,
-+ discriminators,
-+ parent,
-+ );
- debug_context.scopes[parent]
- } else {
- // The root is the function itself.
-@@ -117,7 +141,37 @@ fn make_mir_scope<'ll, 'tcx>(
- // FIXME(eddyb) this doesn't account for the macro-related
- // `Span` fixups that `rustc_codegen_ssa::mir::debuginfo` does.
- let callsite_scope = parent_scope.adjust_dbg_scope_for_span(cx, callsite_span);
-- cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span)
-+ let loc = cx.dbg_loc(callsite_scope, parent_scope.inlined_at, callsite_span);
-+
-+ // NB: In order to produce proper debug info for variables (particularly
-+ // arguments) in multiply-inline functions, LLVM expects to see a single
-+ // DILocalVariable with multiple different DILocations in the IR. While
-+ // the source information for each DILocation would be identical, their
-+ // inlinedAt attributes will be unique to the particular callsite.
-+ //
-+ // We generate DILocations here based on the callsite's location in the
-+ // source code. A single location in the source code usually can't
-+ // produce multiple distinct calls so this mostly works, until
-+ // proc-macros get involved. A proc-macro can generate multiple calls
-+ // at the same span, which breaks the assumption that we're going to
-+ // produce a unique DILocation for every scope we process here. We
-+ // have to explicitly add discriminators if we see inlines into the
-+ // same source code location.
-+ //
-+ // Note further that we can't key this hashtable on the span itself,
-+ // because these spans could have distinct SyntaxContexts. We have
-+ // to key on exactly what we're giving to LLVM.
-+ match discriminators.entry(callsite_span.lo()) {
-+ Entry::Occupied(mut o) => {
-+ *o.get_mut() += 1;
-+ unsafe { llvm::LLVMRustDILocationCloneWithBaseDiscriminator(loc, *o.get()) }
-+ .expect("Failed to encode discriminator in DILocation")
-+ }
-+ Entry::Vacant(v) => {
-+ v.insert(0);
-+ loc
-+ }
-+ }
- });
-
- debug_context.scopes[scope] = DebugScope {
-diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-index 3d2e270a3868e..75a5ec44c2285 100644
---- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
-@@ -2174,6 +2174,10 @@ unsafe extern "C" {
- Scope: &'a DIScope,
- InlinedAt: Option<&'a DILocation>,
- ) -> &'a DILocation;
-+ pub fn LLVMRustDILocationCloneWithBaseDiscriminator<'a>(
-+ Location: &'a DILocation,
-+ BD: c_uint,
-+ ) -> Option<&'a DILocation>;
- pub fn LLVMRustDIBuilderCreateOpDeref() -> u64;
- pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> u64;
- pub fn LLVMRustDIBuilderCreateOpLLVMFragment() -> u64;
-diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-index 9330c83b7f230..cd70c3f266920 100644
---- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
-@@ -1305,6 +1305,14 @@ LLVMRustDIBuilderCreateDebugLocation(unsigned Line, unsigned Column,
- return wrap(Loc);
- }
-
-+extern "C" LLVMMetadataRef
-+LLVMRustDILocationCloneWithBaseDiscriminator(LLVMMetadataRef Location,
-+ unsigned BD) {
-+ DILocation *Loc = unwrapDIPtr<DILocation>(Location);
-+ auto NewLoc = Loc->cloneWithBaseDiscriminator(BD);
-+ return wrap(NewLoc.has_value() ? NewLoc.value() : nullptr);
-+}
-+
- extern "C" uint64_t LLVMRustDIBuilderCreateOpDeref() {
- return dwarf::DW_OP_deref;
- }
-diff --git a/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
-new file mode 100644
-index 0000000000000..159ecfd09743d
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/auxiliary/macro_def.rs
-@@ -0,0 +1,11 @@
-+//@ force-host
-+//@ no-prefer-dynamic
-+#![crate_type = "proc-macro"]
-+
-+extern crate proc_macro;
-+use proc_macro::*;
-+
-+#[proc_macro]
-+pub fn square_twice(_item: TokenStream) -> TokenStream {
-+ "(square(env::vars().count() as i32), square(env::vars().count() as i32))".parse().unwrap()
-+}
-diff --git a/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
-new file mode 100644
-index 0000000000000..c3858044c0c9f
---- /dev/null
-+++ b/tests/codegen/debuginfo-proc-macro/mir_inlined_twice_var_locs.rs
-@@ -0,0 +1,53 @@
-+//@ min-llvm-version: 19
-+//@ compile-flags: -Cdebuginfo=2 -Copt-level=0 -Zmir-enable-passes=+Inline
-+// MSVC is different because of the individual allocas.
-+//@ ignore-msvc
-+
-+//@ aux-build:macro_def.rs
-+
-+// Find the variable.
-+// CHECK-DAG: ![[#var_dbg:]] = !DILocalVariable(name: "n",{{( arg: 1,)?}} scope: ![[#var_scope:]]
-+
-+// Find both dbg_declares. These will proceed the variable metadata, of course, so we're looking
-+// backwards.
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill{{[0-9]}}, ![[#var_dbg]], !DIExpression(), ![[#var_loc2:]])
-+// CHECK-DAG: dbg_declare(ptr %n.dbg.spill, ![[#var_dbg]], !DIExpression(), ![[#var_loc1:]])
-+
-+// Find the first location definition, looking forwards again.
-+// CHECK: ![[#var_loc1]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope:]], inlinedAt: ![[#var_inlinedAt1:]]
-+
-+// Find the first location's inlinedAt
-+// NB: If we fail here it's *probably* because we failed to produce two
-+// different locations and ended up reusing an earlier one.
-+// CHECK: ![[#var_inlinedAt1]] = !DILocation
-+// CHECK-SAME: scope: ![[var_inlinedAt1_scope:]]
-+
-+// Find the second location definition, still looking forwards.
-+// NB: If we failed to produce two different locations, the test will
-+// definitely fail by this point (if it hasn't already) because we won't
-+// be able to find the same line again.
-+// CHECK: ![[#var_loc2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_scope]], inlinedAt: ![[#var_inlinedAt2:]]
-+
-+// Find the second location's inlinedAt.
-+// CHECK: ![[#var_inlinedAt2]] = !DILocation
-+// CHECK-SAME: scope: ![[#var_inlinedAt2_scope:]]
-+
-+// Finally, check that a discriminator was emitted for the second scope.
-+// FIXMEkhuey ideally we would check that *either* scope has a discriminator
-+// but I don't know that it's possible to check that with FileCheck.
-+// CHECK: ![[#var_inlinedAt2_scope]] = !DILexicalBlockFile
-+// CHECK-SAME: discriminator: [[#]]
-+extern crate macro_def;
-+
-+use std::env;
-+
-+fn square(n: i32) -> i32 {
-+ n * n
-+}
-+
-+fn main() {
-+ let (z1, z2) = macro_def::square_twice!();
-+ println!("{z1} == {z2}");
-+}
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 9092377df42675a5939ec6ca236380e4d6304738
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=9092377d
Add patches for Rust 1.84.1-r2
Patches:
- 1.78.0-musl-dynamic-linking.patch
- 1.83.0-cross-compile-libz.patch
- 1.67.0-doc-wasm.patch
- 1.84.1-fix-cross.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.84.1-fix-cross.patch | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
new file mode 100644
index 0000000..47d7766
--- /dev/null
+++ b/1.84.1-fix-cross.patch
@@ -0,0 +1,30 @@
+https://github.com/rust-lang/rust/issues/133629
+https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
+
+From: onur-ozkan <work@onurozkan.dev>
+Date: Thu, 30 Jan 2025 16:51:08 +0000
+Subject: [PATCH] set rustc dylib on manually constructed rustc command
+
+Signed-off-by: onur-ozkan <work@onurozkan.dev>
+--- a/src/bootstrap/src/core/builder/cargo.rs
++++ b/src/bootstrap/src/core/builder/cargo.rs
+@@ -653,7 +653,10 @@ impl Builder<'_> {
+ // Build proc macros both for the host and the target unless proc-macros are not
+ // supported by the target.
+ if target != compiler.host && cmd_kind != Kind::Check {
+- let error = command(self.rustc(compiler))
++ let mut rustc_cmd = command(self.rustc(compiler));
++ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
++
++ let error = rustc_cmd
+ .arg("--target")
+ .arg(target.rustc_target_arg())
+ .arg("--print=file-names")
+@@ -661,6 +664,7 @@ impl Builder<'_> {
+ .arg("-")
+ .run_capture(self)
+ .stderr();
++
+ let not_supported = error
+ .lines()
+ .any(|line| line.contains("unsupported crate type `proc-macro`"));
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 7eae817a8ce314b0cfed4a26232b04b4bf535a80
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=7eae817a
Add patches for Rust 1.85.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.78.0-musl-dynamic-linking.patch | 19 --
1.84.1-fix-cross.patch | 30 ---
...e-libz.patch => 1.85.0-cross-compile-libz.patch | 21 +-
1.85.0-musl-dynamic-linking.patch | 271 +++++++++++++++++++++
4 files changed, 284 insertions(+), 57 deletions(-)
diff --git a/1.78.0-musl-dynamic-linking.patch b/1.78.0-musl-dynamic-linking.patch
deleted file mode 100644
index 25a281c..0000000
--- a/1.78.0-musl-dynamic-linking.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From e42709c46647dab342b826d30324f3e6e5590e00 Mon Sep 17 00:00:00 2001
-From: Jory Pratt <anarchy@gentoo.org>
-Date: Tue, 2 Aug 2022 18:32:53 -0500
-Subject: [PATCH] Enable dynamic linking by default for musl
-
-Signed-off-by: Jory Pratt <anarchy@gentoo.org>
---- a/compiler/rustc_target/src/spec/base/linux_musl.rs
-+++ b/compiler/rustc_target/src/spec/base/linux_musl.rs
-@@ -10,7 +10,7 @@ pub fn opts() -> TargetOptions {
- base.link_self_contained = LinkSelfContainedDefault::InferredForMusl;
-
- // These targets statically link libc by default
-- base.crt_static_default = true;
-+ base.crt_static_default = false;
-
- base
- }
---
-2.35.1
diff --git a/1.84.1-fix-cross.patch b/1.84.1-fix-cross.patch
deleted file mode 100644
index 47d7766..0000000
--- a/1.84.1-fix-cross.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-https://github.com/rust-lang/rust/issues/133629
-https://github.com/rust-lang/rust/commit/a24d859f19bbefe5371694f318568b0ab5a13299
-
-From: onur-ozkan <work@onurozkan.dev>
-Date: Thu, 30 Jan 2025 16:51:08 +0000
-Subject: [PATCH] set rustc dylib on manually constructed rustc command
-
-Signed-off-by: onur-ozkan <work@onurozkan.dev>
---- a/src/bootstrap/src/core/builder/cargo.rs
-+++ b/src/bootstrap/src/core/builder/cargo.rs
-@@ -653,7 +653,10 @@ impl Builder<'_> {
- // Build proc macros both for the host and the target unless proc-macros are not
- // supported by the target.
- if target != compiler.host && cmd_kind != Kind::Check {
-- let error = command(self.rustc(compiler))
-+ let mut rustc_cmd = command(self.rustc(compiler));
-+ self.add_rustc_lib_path(compiler, &mut rustc_cmd);
-+
-+ let error = rustc_cmd
- .arg("--target")
- .arg(target.rustc_target_arg())
- .arg("--print=file-names")
-@@ -661,6 +664,7 @@ impl Builder<'_> {
- .arg("-")
- .run_capture(self)
- .stderr();
-+
- let not_supported = error
- .lines()
- .any(|line| line.contains("unsupported crate type `proc-macro`"));
diff --git a/1.83.0-cross-compile-libz.patch b/1.85.0-cross-compile-libz.patch
similarity index 50%
rename from 1.83.0-cross-compile-libz.patch
rename to 1.85.0-cross-compile-libz.patch
index 12844fd..7bd45c4 100644
--- a/1.83.0-cross-compile-libz.patch
+++ b/1.85.0-cross-compile-libz.patch
@@ -1,21 +1,26 @@
-https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
-https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
+From 768f7e50a6d9a3db4e4eef45dcb4c56e9b580389 Mon Sep 17 00:00:00 2001
+From: Matt Jolly <kangie@gentoo.org>
+Date: Sun, 9 Feb 2025 21:12:43 +1000
+Subject: [PATCH] Update libz cross-compile patch for 9999 (1.86.0)
-diff --git a/compiler/rustc_llvm/build.rs b/compiler/rustc_llvm/build.rs
-index f606fa483ca..8a2e1c40e8b 100644
+See-also: https://paste.sr.ht/~kchibisov/682321e0fd4a3ece4a4b7b71591896f5cd3cdb22
+See-also: https://github.com/gentoo/gentoo/pull/35246#discussion_r1484525497
--- a/compiler/rustc_llvm/build.rs
+++ b/compiler/rustc_llvm/build.rs
-@@ -220,12 +220,7 @@
+@@ -219,13 +219,7 @@ fn main() {
+ // of llvm-config, not the target that we're attempting to link.
let mut cmd = Command::new(&llvm_config);
cmd.arg(llvm_link_arg).arg("--libs");
-
-- // Don't link system libs if cross-compiling unless targetting Windows.
+-
+- // Don't link system libs if cross-compiling unless targeting Windows.
- // On Windows system DLLs aren't linked directly, instead import libraries are used.
- // These import libraries are independent of the host.
- if !is_crossed || target.contains("windows") {
- cmd.arg("--system-libs");
- }
+ cmd.arg("--system-libs");
-
+
// We need libkstat for getHostCPUName on SPARC builds.
// See also: https://github.com/llvm/llvm-project/issues/64186
+--
+2.48.0
diff --git a/1.85.0-musl-dynamic-linking.patch b/1.85.0-musl-dynamic-linking.patch
new file mode 100644
index 0000000..a6ab967
--- /dev/null
+++ b/1.85.0-musl-dynamic-linking.patch
@@ -0,0 +1,271 @@
+From be965af5421e55c0032a989b220bc0da005d2272 Mon Sep 17 00:00:00 2001
+From: Michal Rostecki <vadorovsky@protonmail.com>
+Date: Tue, 25 Feb 2025 16:24:21 +0100
+Subject: [PATCH] Enable dynamic linking by default for musl
+
+---
+ .../src/spec/targets/aarch64_unknown_linux_musl.rs | 3 ---
+ .../src/spec/targets/arm_unknown_linux_musleabi.rs | 3 +--
+ .../src/spec/targets/arm_unknown_linux_musleabihf.rs | 3 +--
+ .../src/spec/targets/armv5te_unknown_linux_musleabi.rs | 3 +--
+ .../src/spec/targets/armv7_unknown_linux_musleabi.rs | 3 +--
+ .../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 | 2 --
+ .../src/spec/targets/powerpc64_unknown_linux_musl.rs | 2 --
+ .../src/spec/targets/powerpc64le_unknown_linux_musl.rs | 2 --
+ .../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, 8 insertions(+), 37 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 4fefdfa5c5e..bb65048a56d 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
+@@ -12,9 +12,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+-
+ Target {
+ llvm_target: "aarch64-unknown-linux-musl".into(),
+ metadata: crate::spec::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 26241dd0bd4..cab79e2bf7d 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 {
+ features: "+strict-align,+v6".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/arm_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs
+index 4bbde7667b9..c5f6c180a95 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 {
+ features: "+strict-align,+v6,+vfp2,-d32".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/armv5te_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs
+index 62619546891..680dafe6943 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 {
+ max_atomic_width: Some(32),
+ mcount: "\u{1}mcount".into(),
+ has_thumb_interworking: true,
+- // 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/armv7_unknown_linux_musleabi.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs
+index 0436e0d8df4..e862b28ca92 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 {
+ features: "+v7,+thumb2,+soft-float,-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/armv7_unknown_linux_musleabihf.rs b/compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs
+index 22e49f2f1b0..acb7c99cdaf 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 {
+ features: "+v7,+vfp3,-d32,+thumb2,-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/i586_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/targets/i586_unknown_linux_musl.rs
+index 8ad93496f3a..623422a89ea 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
+@@ -4,7 +4,5 @@ pub(crate) fn target() -> Target {
+ let mut base = super::i686_unknown_linux_musl::target();
+ base.cpu = "pentium".into();
+ base.llvm_target = "i586-unknown-linux-musl".into();
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ 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 6ba87c732b7..b805b80b85b 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
+@@ -6,8 +6,6 @@ pub(crate) fn target() -> Target {
+ base.max_atomic_width = Some(64);
+ base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m32", "-Wl,-melf_i386"]);
+ base.stack_probes = StackProbeType::Inline;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ // 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 32f5c79d653..9a25fe773fb 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
+@@ -22,8 +22,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,
+ ..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 5e7c37fd46c..4f50e8b7033 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,6 @@ pub(crate) fn target() -> Target {
+ base.cpu = "mips64r2".into();
+ base.features = "+mips64r2".into();
+ base.max_atomic_width = Some(64);
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+ 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 a54b17c87a7..a964f417799 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
+@@ -7,8 +7,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64-unknown-linux-musl".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 f763c37f535..d0335506f16 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
+@@ -6,8 +6,6 @@ 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;
+
+ Target {
+ llvm_target: "powerpc64le-unknown-linux-musl".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 0cd0ea96ad3..5372a83e29a 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
+@@ -6,8 +6,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 b86c3c2e8e0..2305db81c5e 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
+@@ -6,8 +6,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 a07429bb0c5..cf2d7669a8a 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 fbe8c48eca7..7a78004927b 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
+@@ -12,8 +12,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 1149b6d16eb..e1e060c211d 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 8dcdc5be8a9..8be0f335db9 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
+@@ -14,8 +14,6 @@ pub(crate) fn target() -> Target {
+ | SanitizerSet::MEMORY
+ | SanitizerSet::THREAD;
+ base.supports_xray = true;
+- // FIXME(compiler-team#422): musl targets should be dynamically linked by default.
+- base.crt_static_default = true;
+
+ Target {
+ llvm_target: "x86_64-unknown-linux-musl".into(),
+--
+2.45.3
+
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 204cc9d70b9430c4d91d1261875b82d71981cc2c
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=204cc9d7
Add patches for Rust 1.86.0-r2
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.86.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 186 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 186 insertions(+)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
new file mode 100644
index 0000000..5b93a76
--- /dev/null
+++ b/1.86.0-znver.patch
@@ -0,0 +1,186 @@
+https://github.com/rust-lang/rust/issues/138054
+https://bugs.gentoo.org/953109#c7
+diff --git a/library/portable-simd/crates/core_simd/src/lib.rs b/library/portable-simd/crates/core_simd/src/lib.rs
+index 7f57847c9c234..717b882b64ba1 100644
+--- a/library/portable-simd/crates/core_simd/src/lib.rs
++++ b/library/portable-simd/crates/core_simd/src/lib.rs
+@@ -35,7 +35,11 @@
+ feature(stdarch_x86_avx512)
+ )]
+ #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
+-#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
++#![deny(
++ unsafe_op_in_unsafe_fn,
++ unreachable_pub,
++ clippy::undocumented_unsafe_blocks
++)]
+ #![doc(test(attr(deny(warnings))))]
+ #![allow(internal_features)]
+ #![unstable(feature = "portable_simd", issue = "86656")]
+diff --git a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+index db4312d5bf88a..8221d8f17e90e 100644
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -5,7 +5,7 @@ use core::marker::PhantomData;
+
+ /// A mask where each lane is represented by a single bit.
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(
++pub(crate) struct Mask<T, const N: usize>(
+ <LaneCount<N> as SupportedLaneCount>::BitMask,
+ PhantomData<T>,
+ )
+@@ -78,7 +78,7 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ if value {
+ mask.as_mut().fill(u8::MAX)
+@@ -93,12 +93,12 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ unsafe {
+ self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
+ }
+@@ -106,7 +106,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ unsafe {
+ core::intrinsics::simd::simd_select_bitmask(
+ self.0,
+@@ -118,19 +118,19 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
+ }
+
+ #[inline]
+- pub fn to_bitmask_integer(self) -> u64 {
++ pub(crate) fn to_bitmask_integer(self) -> u64 {
+ let mut bitmask = [0u8; 8];
+ bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
+ u64::from_ne_bytes(bitmask)
+ }
+
+ #[inline]
+- pub fn from_bitmask_integer(bitmask: u64) -> Self {
++ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
+ let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
+ let len = bytes.as_mut().len();
+ bytes
+@@ -141,7 +141,7 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -151,13 +151,13 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ self != Self::splat(false)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ self == Self::splat(true)
+ }
+ }
+diff --git a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+index ae55cf1f8fa87..a693ea90b9cb8 100644
+--- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
+@@ -3,7 +3,7 @@
+ use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
+
+ #[repr(transparent)]
+-pub struct Mask<T, const N: usize>(Simd<T, N>)
++pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
+ where
+ T: MaskElement,
+ LaneCount<N>: SupportedLaneCount;
+@@ -103,36 +103,36 @@ where
+ {
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn splat(value: bool) -> Self {
++ pub(crate) fn splat(value: bool) -> Self {
+ Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
++ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
+ T::eq(self.0[lane], T::TRUE)
+ }
+
+ #[inline]
+- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
++ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
+ self.0[lane] = if value { T::TRUE } else { T::FALSE }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new vector and does not mutate the original value"]
+- pub fn to_int(self) -> Simd<T, N> {
++ pub(crate) fn to_int(self) -> Simd<T, N> {
+ self.0
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
++ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
+ Self(value)
+ }
+
+ #[inline]
+ #[must_use = "method returns a new mask and does not mutate the original value"]
+- pub fn convert<U>(self) -> Mask<U, N>
++ pub(crate) fn convert<U>(self) -> Mask<U, N>
+ where
+ U: MaskElement,
+ {
+@@ -221,14 +221,14 @@ where
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn any(self) -> bool {
++ pub(crate) fn any(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
+ }
+
+ #[inline]
+ #[must_use = "method returns a new bool and does not mutate the original value"]
+- pub fn all(self) -> bool {
++ pub(crate) fn all(self) -> bool {
+ // Safety: use `self` as an integer vector
+ unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
+ }
^ permalink raw reply related [flat|nested] 48+ messages in thread
* [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
@ 2025-06-03 4:33 ` Matt Jolly
0 siblings, 0 replies; 48+ messages in thread
From: Matt Jolly @ 2025-06-03 4:33 UTC (permalink / raw
To: gentoo-commits
commit: 6c6db08cf73f42307f92d611b22e7e28b028583b
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:40 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:40 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=6c6db08c
Add patches for Rust 1.87.0-r1
Patches:
- 1.85.0-cross-compile-libz.patch
- 1.85.0-musl-dynamic-linking.patch
- 1.67.0-doc-wasm.patch
- 1.87.0-znver.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.86.0-znver.patch | 186 -----------------------------------------------------
1.87.0-znver.patch | 9 +++
2 files changed, 9 insertions(+), 186 deletions(-)
diff --git a/1.86.0-znver.patch b/1.86.0-znver.patch
deleted file mode 100644
index 5b93a76..0000000
--- a/1.86.0-znver.patch
+++ /dev/null
@@ -1,186 +0,0 @@
-https://github.com/rust-lang/rust/issues/138054
-https://bugs.gentoo.org/953109#c7
-diff --git a/library/portable-simd/crates/core_simd/src/lib.rs b/library/portable-simd/crates/core_simd/src/lib.rs
-index 7f57847c9c234..717b882b64ba1 100644
---- a/library/portable-simd/crates/core_simd/src/lib.rs
-+++ b/library/portable-simd/crates/core_simd/src/lib.rs
-@@ -35,7 +35,11 @@
- feature(stdarch_x86_avx512)
- )]
- #![warn(missing_docs, clippy::missing_inline_in_public_items)] // basically all items, really
--#![deny(unsafe_op_in_unsafe_fn, clippy::undocumented_unsafe_blocks)]
-+#![deny(
-+ unsafe_op_in_unsafe_fn,
-+ unreachable_pub,
-+ clippy::undocumented_unsafe_blocks
-+)]
- #![doc(test(attr(deny(warnings))))]
- #![allow(internal_features)]
- #![unstable(feature = "portable_simd", issue = "86656")]
-diff --git a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-index db4312d5bf88a..8221d8f17e90e 100644
---- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
-@@ -5,7 +5,7 @@ use core::marker::PhantomData;
-
- /// A mask where each lane is represented by a single bit.
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(
-+pub(crate) struct Mask<T, const N: usize>(
- <LaneCount<N> as SupportedLaneCount>::BitMask,
- PhantomData<T>,
- )
-@@ -78,7 +78,7 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- let mut mask = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- if value {
- mask.as_mut().fill(u8::MAX)
-@@ -93,12 +93,12 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- (self.0.as_ref()[lane / 8] >> (lane % 8)) & 0x1 > 0
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- unsafe {
- self.0.as_mut()[lane / 8] ^= ((value ^ self.test_unchecked(lane)) as u8) << (lane % 8)
- }
-@@ -106,7 +106,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- unsafe {
- core::intrinsics::simd::simd_select_bitmask(
- self.0,
-@@ -118,19 +118,19 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- unsafe { Self(core::intrinsics::simd::simd_bitmask(value), PhantomData) }
- }
-
- #[inline]
-- pub fn to_bitmask_integer(self) -> u64 {
-+ pub(crate) fn to_bitmask_integer(self) -> u64 {
- let mut bitmask = [0u8; 8];
- bitmask[..self.0.as_ref().len()].copy_from_slice(self.0.as_ref());
- u64::from_ne_bytes(bitmask)
- }
-
- #[inline]
-- pub fn from_bitmask_integer(bitmask: u64) -> Self {
-+ pub(crate) fn from_bitmask_integer(bitmask: u64) -> Self {
- let mut bytes = <LaneCount<N> as SupportedLaneCount>::BitMask::default();
- let len = bytes.as_mut().len();
- bytes
-@@ -141,7 +141,7 @@ where
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -151,13 +151,13 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- self != Self::splat(false)
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- self == Self::splat(true)
- }
- }
-diff --git a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-index ae55cf1f8fa87..a693ea90b9cb8 100644
---- a/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-+++ b/library/portable-simd/crates/core_simd/src/masks/full_masks.rs
-@@ -3,7 +3,7 @@
- use crate::simd::{LaneCount, MaskElement, Simd, SupportedLaneCount};
-
- #[repr(transparent)]
--pub struct Mask<T, const N: usize>(Simd<T, N>)
-+pub(crate) struct Mask<T, const N: usize>(Simd<T, N>)
- where
- T: MaskElement,
- LaneCount<N>: SupportedLaneCount;
-@@ -103,36 +103,36 @@ where
- {
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn splat(value: bool) -> Self {
-+ pub(crate) fn splat(value: bool) -> Self {
- Self(Simd::splat(if value { T::TRUE } else { T::FALSE }))
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub unsafe fn test_unchecked(&self, lane: usize) -> bool {
-+ pub(crate) unsafe fn test_unchecked(&self, lane: usize) -> bool {
- T::eq(self.0[lane], T::TRUE)
- }
-
- #[inline]
-- pub unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
-+ pub(crate) unsafe fn set_unchecked(&mut self, lane: usize, value: bool) {
- self.0[lane] = if value { T::TRUE } else { T::FALSE }
- }
-
- #[inline]
- #[must_use = "method returns a new vector and does not mutate the original value"]
-- pub fn to_int(self) -> Simd<T, N> {
-+ pub(crate) fn to_int(self) -> Simd<T, N> {
- self.0
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
-+ pub(crate) unsafe fn from_int_unchecked(value: Simd<T, N>) -> Self {
- Self(value)
- }
-
- #[inline]
- #[must_use = "method returns a new mask and does not mutate the original value"]
-- pub fn convert<U>(self) -> Mask<U, N>
-+ pub(crate) fn convert<U>(self) -> Mask<U, N>
- where
- U: MaskElement,
- {
-@@ -221,14 +221,14 @@ where
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn any(self) -> bool {
-+ pub(crate) fn any(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_any(self.to_int()) }
- }
-
- #[inline]
- #[must_use = "method returns a new bool and does not mutate the original value"]
-- pub fn all(self) -> bool {
-+ pub(crate) fn all(self) -> bool {
- // Safety: use `self` as an integer vector
- unsafe { core::intrinsics::simd::simd_reduce_all(self.to_int()) }
- }
diff --git a/1.87.0-znver.patch b/1.87.0-znver.patch
new file mode 100644
index 0000000..11424a4
--- /dev/null
+++ b/1.87.0-znver.patch
@@ -0,0 +1,9 @@
+https://bugs.gentoo.org/956018#c3
+--- a/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
++++ b/library/portable-simd/crates/core_simd/src/masks/bitmask.rs
+@@ -1,4 +1,5 @@
+ #![allow(unused_imports)]
++#![allow(unused_attributes)]
+ use super::MaskElement;
+ use crate::simd::{LaneCount, Simd, SupportedLaneCount};
+ use core::marker::PhantomData;
^ permalink raw reply related [flat|nested] 48+ messages in thread
end of thread, other threads:[~2025-06-03 4:41 UTC | newest]
Thread overview: 48+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.86 commit in: / Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:1.88 " Matt Jolly
2025-06-02 9:48 ` [gentoo-commits] proj/rust-patches:master " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.86.0-r2 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 " Matt Jolly
-- strict thread matches above, loose matches on Subject: below --
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:48 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-02 9:49 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.77 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02 9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02 9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox