public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.76 commit in: /
Date: Mon, 02 Jun 2025 09:25:11 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.77 commit in: /
Date: Mon, 02 Jun 2025 09:25:11 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092511.sKkFIYAsAgwMW5NLou-ZUBurkLDTzIGnQGEpybN1j2w@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.78 commit in: /
Date: Mon, 02 Jun 2025 09:25:12 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092512.m4CrKTndSipDbyBqfknVRPi0UW77kcK6hnxyeJU24DY@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.79 commit in: /
Date: Mon, 02 Jun 2025 09:25:12 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092512.FmpduEF-Ob5Jpq0ODo_0vzG2KBuEBzMMzFweiyI8jDo@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.80 commit in: /
Date: Mon, 02 Jun 2025 09:25:13 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092513.IuHUYOvbm9SX2vcHfLjMLREzMrbQtqSn-eXuAwBUC8I@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.81 commit in: /
Date: Mon, 02 Jun 2025 09:25:14 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092514.TjPRXIdAVm1QpPD05fbgKopD_owLZO-iiHzZ5nBDm4A@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.82 commit in: /
Date: Mon, 02 Jun 2025 09:25:14 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092514.CqaOngyQeRGgy6skPKY88MvNgAnvvqRr4BVKwSMGbL0@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.83 commit in: /
Date: Mon, 02 Jun 2025 09:25:15 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092515.BqpJVbtlZzS-2d_nCZkYCIjnYzcE4goX7nB6f5tCFsQ@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.84 commit in: /
Date: Mon, 02 Jun 2025 09:25:16 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092516.LVO7tx4nZHoGqJw2g48TrZER0GqQi9hoglbE-AHZzKA@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.85 commit in: /
Date: Mon, 02 Jun 2025 09:25:17 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092517.8DeFKLCVVwX8XsOFyhKQQT00ZscD6orAt3n_Z014wy8@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.86 commit in: /
Date: Mon, 02 Jun 2025 09:25:19 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092519.JXu98g3y16teqE4FzA7FPEkJaLkj5jdU_ybW9Qz86ec@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.87 commit in: /
Date: Mon, 02 Jun 2025 09:25:20 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092520.tbSXDzxO0hfP6tHMhS8rgkBI4MuB2-_tQo3OIGWCF58@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.88 commit in: /
Date: Mon, 02 Jun 2025 09:25:22 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092522.bDwqIASnYPljBS85SQ19ZEszq1DnfjNoQw52_AQjVSM@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:master commit in: /
Date: Mon, 02 Jun 2025 09:25:23 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602092523.jm0m_ASr7d1tw74hoLzSAZc_jDdp4FEBkETjh_lu2rA@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.76.0-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:22 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093422.yLYPmSByUuVMN1jYR7vxL9JGPbLid7dpuOCwMfYDU18@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.77.1-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:23 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093423.aD4QMbpow-vU3NS6Y5AYBUJ8sNE3oeaaYpA-jVHWDqw@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.78.0-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:23 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093423.g8kdWmqSE6Ws1kyhgTZjvrJnVpdi8cD6y-dzOKsqH7I@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.79.0-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:23 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093423.dDzNYHbcPWrl0Fj8GH6HE8U9uI35T1F2s4-_sKxe1rI@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.80.1-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:24 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093424.hVi5JwQppRkCnkJqQ4Ru3_p_zNtvKK80FB8qDppblIs@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.81.0-r101 commit in: /
Date: Mon, 02 Jun 2025 09:34:24 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093424.QQ4ALyUq6Q-0l2M8YQq9toH6E9fCvEFzMlRdimCb3q0@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.82.0-r103 commit in: /
Date: Mon, 02 Jun 2025 09:34:25 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093425.-AhixWn8rRG-8fICqNT3GfTB8tJAnGvfwObDcbDT7Sw@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.83.0-r3 commit in: /
Date: Mon, 02 Jun 2025 09:34:26 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093426.CJnwfHg_NgV_UrXvSod08f_zdkXgYnLpJF98_qMklpQ@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.84.0-r2 commit in: /
Date: Mon, 02 Jun 2025 09:34:26 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093426.khrm46uvXZdiScpGVISXx1piNzS5K-3enOURKkbGo08@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.84.1-r2 commit in: /
Date: Mon, 02 Jun 2025 09:34:27 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093427.Boj7rNt-oPWlpcb1-eZ4H7RIiMaFD3sep0nB-cCt_lA@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.85.0-r2 commit in: /
Date: Mon, 02 Jun 2025 09:34:28 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093428.1Aj8t-0Qr-9XSPBgbuMp9d99_akhjdyYN33mJtz33s4@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.85.1-r1 commit in: /
Date: Mon, 02 Jun 2025 09:34:29 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093429.3RIovC4aM19ExbDfgSbXJ90FSlC0PpGy9jxyeklv9l0@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.86.0-r2 commit in: /
Date: Mon, 02 Jun 2025 09:34:30 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093430.eFy2qnjEiB0Pc1Zwwmc0Zzjg0FQm7-EsDzWXJDJRcUQ@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: /
Date: Mon, 02 Jun 2025 09:34:31 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093431.Euai4KD7awchzhhY3xCwFHoXNXDRnKhS9l8GYlSB_zo@z> (raw)

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
+


WARNING: multiple messages have this Message-ID (diff)
From: "Matt Jolly" <kangie@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 commit in: /
Date: Mon, 02 Jun 2025 09:34:32 +0000 (UTC)	[thread overview]
Message-ID: <1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo> (raw)
Message-ID: <20250602093432.qo0IEVv4RjbnOd3_FKfy09TY7vZrJEoqBuE_h3eWURI@z> (raw)

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
+


             reply	other threads:[~2025-06-02  9:25 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02  9:25 Matt Jolly [this message]
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.77 commit in: / Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.79 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.81 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.88 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:master " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.76.0-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.77.1-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.79.0-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.78.0-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.81.0-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.80.1-r101 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.82.0-r103 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.83.0-r3 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.84.0-r2 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.84.1-r2 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.85.0-r2 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.85.1-r1 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.86.0-r2 " Matt Jolly
2025-06-02  9:34 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-02  9:34 ` [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.76 " 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.76 " 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.76 " 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.76 " Matt Jolly
2025-06-02  9:48 Matt Jolly
2025-06-02  9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02  9:48 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02  9:48 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-02  9:48 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02  9:48 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02  9:48 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02  9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02  9:25 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-06-02  9:25 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-06-02  9:25 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:55 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-05-31  5:55 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:55 Matt Jolly
2025-05-31  5:55 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-05-31  5:55 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:55 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-05-31  5:55 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:53 Matt Jolly
2025-05-31  5:53 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-05-31  5:53 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:53 [gentoo-commits] proj/rust-patches:1.75 " Matt Jolly
2025-05-31  5:53 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly
2025-05-31  5:53 [gentoo-commits] proj/rust-patches:1.74 " Matt Jolly
2025-05-31  5:53 ` [gentoo-commits] proj/rust-patches:1.76 " Matt Jolly

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1748856136.e6afd1fe4bd15d46f748745ba16c6206b14a62c6.kangie@gentoo \
    --to=kangie@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox