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: Tue, 03 Jun 2025 04:33:53 +0000 (UTC) [thread overview]
Message-ID: <1748925099.393b2e904eeb04515d75f24a948aa26f16098529.kangie@gentoo> (raw)
Message-ID: <20250603043353.M9LWlZLCcI7f1BbmQpMjwYORgFkXGiPs0l3-WmYXffU@z> (raw)
commit: 393b2e904eeb04515d75f24a948aa26f16098529
Author: Matt Jolly <kangie <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 3 04:31:39 2025 +0000
Commit: Matt Jolly <kangie <AT> gentoo <DOT> org>
CommitDate: Tue Jun 3 04:31:39 2025 +0000
URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=393b2e90
Add patches for Rust 1.76.0-r101
Patches:
- 1.67.0-doc-wasm.patch
- 1.70.0-ignore-broken-and-non-applicable-tests.patch
- 1.74.1-cross-compile-libz.patch
- 1.81.0-backport-bug937164.patch
- 1.81.0-backport-llvm-pr101761.patch
- 1.81.0-backport-llvm-pr101766.patch
- 1.75.0-handle-vendored-sources.patch
- 1.75.0-musl-dynamic-linking.patch
- 1.76.0-loong-code-model.patch
Signed-off-by: Matt Jolly <kangie <AT> gentoo.org>
1.76.0-loong-code-model.patch | 73 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)
diff --git a/1.76.0-loong-code-model.patch b/1.76.0-loong-code-model.patch
new file mode 100644
index 0000000..02bfeca
--- /dev/null
+++ b/1.76.0-loong-code-model.patch
@@ -0,0 +1,73 @@
+https://github.com/rust-lang/rust/pull/120661
+From: WANG Xuerui <xen0n@gentoo.org>
+Date: Mon, 5 Feb 2024 13:18:32 +0800
+Subject: [PATCH] target: default to the medium code model on LoongArch targets
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The Rust LoongArch targets have been using the default LLVM code model
+so far, which is "small" in LLVM-speak and "normal" in LoongArch-speak.
+As described in the "Code Model" section of LoongArch ELF psABI spec
+v20231219 [1], one can only make function calls as far as ±128MiB with
+the "normal" code model; this is insufficient for very large software
+containing Rust components that needs to be linked into the big text
+section, such as Chromium.
+
+Because:
+
+* we do not want to ask users to recompile std if they are to build
+ such software,
+* objects compiled with larger code models can be linked with those
+ with smaller code models without problems, and
+* the "medium" code model is comparable to the "small"/"normal" one
+ performance-wise (same data access pattern; each function call
+ becomes 2-insn long and indirect, but this may be relaxed back into
+ the direct 1-insn form in a future LLVM version), but is able to
+ perform function calls within ±128GiB,
+
+it is better to just switch the targets to the "medium" code model,
+which is also "medium" in LLVM-speak.
+
+[1]: https://github.com/loongson/la-abi-specs/blob/v2.30/laelf.adoc#code-models
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs
+@@ -1,4 +1,4 @@
+-use crate::spec::{base, Target, TargetOptions};
++use crate::spec::{base, CodeModel, Target, TargetOptions};
+
+ pub fn target() -> Target {
+ Target {
+@@ -7,6 +7,7 @@ pub fn target() -> Target {
+ data_layout: "e-m:e-p:64:64-i64:64-i128:128-n64-S128".into(),
+ arch: "loongarch64".into(),
+ options: TargetOptions {
++ code_model: Some(CodeModel::Medium),
+ cpu: "generic".into(),
+ features: "+f,+d".into(),
+ llvm_abiname: "lp64d".into(),
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none.rs
+@@ -16,7 +16,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--- a/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
++++ b/compiler/rustc_target/src/spec/targets/loongarch64_unknown_none_softfloat.rs
+@@ -17,7 +17,7 @@ pub fn target() -> Target {
+ max_atomic_width: Some(64),
+ relocation_model: RelocModel::Static,
+ panic_strategy: PanicStrategy::Abort,
+- code_model: Some(CodeModel::Small),
++ code_model: Some(CodeModel::Medium),
+ ..Default::default()
+ },
+ }
+--
+2.43.0
+
next reply other threads:[~2025-06-03 4:40 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 4:33 Matt Jolly [this message]
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.77 commit in: / Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.78 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.79 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.81 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.80 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.82 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.83 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.84 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.85 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.86 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.88 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.76.0-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.77.1-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.78.0-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.79.0-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.80.1-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.81.0-r101 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.82.0-r103 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.83.0-r3 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.84.0-r2 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.84.1-r2 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.85.0-r2 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.85.1-r1 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.86.0-r2 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.87.0-r1 " Matt Jolly
2025-06-03 4:33 ` [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 " Matt Jolly
2025-06-03 4:34 ` [gentoo-commits] proj/rust-patches:master " Matt Jolly
-- strict thread matches above, loose matches on Subject: below --
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 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.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: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: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
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
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=1748925099.393b2e904eeb04515d75f24a948aa26f16098529.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