From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6E5691580E0 for ; Mon, 02 Jun 2025 09:48:49 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 5AC97343245 for ; Mon, 02 Jun 2025 09:48:49 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id E3D08110497; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id D2554110497 for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 89F58343102 for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1FBEE28EE for ; Mon, 02 Jun 2025 09:48:32 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.76 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.76 Date: Mon, 02 Jun 2025 09:48:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0bdd9888-67fa-4316-950f-b145cd5fd8b9 X-Archives-Hash: 94e8865616f41179b79944e5be2e7bcc commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 228381580E0 for ; Mon, 02 Jun 2025 09:48:53 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 1064734322E for ; Mon, 02 Jun 2025 09:48:53 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 07DD41104A8; Mon, 02 Jun 2025 09:48:35 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 025051104A8 for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B2BE33431F8 for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6BB5228F2 for ; Mon, 02 Jun 2025 09:48:32 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.77 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.77 Date: Mon, 02 Jun 2025 09:48:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 7d2895dc-c458-485c-8785-5e2dfc3647e9 X-Archives-Hash: 1a6525626048d1b46ebea1e7aa4dc0fb Message-ID: <20250602094832.RpsYju7ZwNYlSqtRjkB0jB48Wxs3ZZhOoFWcqDFU-ZU@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 92D8F1580E0 for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 7EB3834325C for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7BAFC1104BB; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 6C7E91104BB for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1EA273431FE for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CA6DB28FD for ; Mon, 02 Jun 2025 09:48:32 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.78 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.78 Date: Mon, 02 Jun 2025 09:48:32 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f96b7467-05a7-4631-bc3e-2631803592bf X-Archives-Hash: 8c2f8dac582e13380c9a0751dab06bbd Message-ID: <20250602094832.YX9r7_-pX0kZvjwzmkqx3AHPTMehqeXPuld-oe21RiI@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B1B981580E0 for ; Mon, 02 Jun 2025 09:49:12 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9E80134327D for ; Mon, 02 Jun 2025 09:49:12 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 84A011104C1; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 766A21104BD for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 300D8343210 for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 49AE52529 for ; Mon, 02 Jun 2025 09:48:33 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.79 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.79 Date: Mon, 02 Jun 2025 09:48:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f4dfed48-4096-4e98-a7c3-2b36176cd3fb X-Archives-Hash: 7ee6b96e4f6dc26294193f67c7225564 Message-ID: <20250602094833.W0Y--s_XDUcsTjvzfuR_k-HhZfrpMLcI_QrMD1BN1nE@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 4DAAE1580E0 for ; Mon, 02 Jun 2025 09:49:25 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 36D653432BC for ; Mon, 02 Jun 2025 09:49:25 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id B3F911104CA; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id A19D11104C6 for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6080D343186 for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BBAF52916 for ; Mon, 02 Jun 2025 09:48:33 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.80 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.80 Date: Mon, 02 Jun 2025 09:48:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0d27a595-0aa1-4af5-8f4e-4ad035da90f5 X-Archives-Hash: 2c8e5c4f3d7dd980ce92f1e17c13c082 Message-ID: <20250602094833.Kxy9-DMo93jEBJ3OSbvZekJ2YL_tGxWJgojVRXGDe5I@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id BF9071580E0 for ; Mon, 02 Jun 2025 09:49:35 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id AA8BB3432D0 for ; Mon, 02 Jun 2025 09:49:35 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 10CF61104CE; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 06C631104CD for ; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9D1D8343203 for ; Mon, 02 Jun 2025 09:48:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4B8ED2940 for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.81 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.81 Date: Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 3b872836-d5b3-423c-b374-0509e55aaad9 X-Archives-Hash: 9f6fa7977f6eb59dd34260552a724e80 Message-ID: <20250602094834.vzHu3fk13SiehZJlyhdhatYulGwiNFZuikJ8e9CnFus@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 1B2481580E0 for ; Mon, 02 Jun 2025 09:49:50 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 097723432E7 for ; Mon, 02 Jun 2025 09:49:50 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 519201104DA; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 2812C1104D3 for ; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C5E0734321B for ; Mon, 02 Jun 2025 09:48:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D8C01289D for ; Mon, 02 Jun 2025 09:48:34 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.82 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.82 Date: Mon, 02 Jun 2025 09:48:34 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fbc2b403-8c92-46ec-9328-dce5b2bdc897 X-Archives-Hash: 8f8e9b75ddd5ec3b85488ab4342f241c Message-ID: <20250602094834.8ufAgI9bsbrgUkk2ejphujGUHEPoLlLQoIKge8QZi40@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7990C1580E0 for ; Mon, 02 Jun 2025 09:49:58 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 669153432CE for ; Mon, 02 Jun 2025 09:49:58 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 606D31104DB; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 4DCA61104D5 for ; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 08F12343203 for ; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 824B528F8 for ; Mon, 02 Jun 2025 09:48:35 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.83 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.83 Date: Mon, 02 Jun 2025 09:48:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bcd241d2-a531-4559-ba38-8970b4bf3c16 X-Archives-Hash: 661b61b31ed623a8731eac662319e986 Message-ID: <20250602094835.biarh7Hjn9i39vfcZEA9h-fPppt7ahyEq-SsrslKulE@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 40B841580E0 for ; Mon, 02 Jun 2025 09:50:12 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 2CCB9342FDD for ; Mon, 02 Jun 2025 09:50:12 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id AAD741104E2; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id A224B1104E1 for ; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5D52434320F for ; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 39ECB2985 for ; Mon, 02 Jun 2025 09:48:36 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.84 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.84 Date: Mon, 02 Jun 2025 09:48:36 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ea499e05-aaef-4545-9a3e-d67ca0ed763f X-Archives-Hash: f95abda625d5a3ea4a65fb4e9a39496b Message-ID: <20250602094836.k83pj8GA409rWLarNClbda6fTqAYcpky8tTj0GpvhVg@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A8DB01580E0 for ; Mon, 02 Jun 2025 09:50:31 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 95F5E34330B for ; Mon, 02 Jun 2025 09:50:31 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id F045D1104EC; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id D9EF11104E8 for ; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 93D8C343230 for ; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 14EAA28FF for ; Mon, 02 Jun 2025 09:48:37 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.85 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.85 Date: Mon, 02 Jun 2025 09:48:37 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9742b4f6-bcf3-4164-907a-3a26decf6999 X-Archives-Hash: 0e5d5a83a30150f9bff224454ee4d365 Message-ID: <20250602094837.ECU9MQ4iocJTI-dtuXYP1EeHMgYEMxi-kEX4Q93U1yQ@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 417011580E0 for ; Mon, 02 Jun 2025 09:50:46 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 2F22834330B for ; Mon, 02 Jun 2025 09:50:46 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 60A991104F3; Mon, 02 Jun 2025 09:48:41 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 468701104F2 for ; Mon, 02 Jun 2025 09:48:41 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 040A4343213 for ; Mon, 02 Jun 2025 09:48:41 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 032D12940 for ; Mon, 02 Jun 2025 09:48:38 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.86 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.86 Date: Mon, 02 Jun 2025 09:48:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 799e0e1e-063e-4996-b9e8-be0532b740b7 X-Archives-Hash: 65f5aca101431471ca8d018cd26d7b0a Message-ID: <20250602094838.hwXbZYnWNyte-AL-BXDeXBWzczzpvVoL6XEEWX56ak8@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 305281580E0 for ; Mon, 02 Jun 2025 09:51:13 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 1C3DA343370 for ; Mon, 02 Jun 2025 09:51:13 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id DD102110506; Mon, 02 Jun 2025 09:48:42 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id C9E8D110507 for ; Mon, 02 Jun 2025 09:48:42 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 86A4D343206 for ; Mon, 02 Jun 2025 09:48:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 08F7C295A for ; Mon, 02 Jun 2025 09:48:39 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.87 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.87 Date: Mon, 02 Jun 2025 09:48:39 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d9d252d6-a3e8-4761-beb8-11b823f53b0a X-Archives-Hash: d3fb7bc88d949d41f60dd22a3164a7c4 Message-ID: <20250602094839.C2Cyn7VsfmQfCVtXagGvTIw2ff9RqKDt5eLyf8FaNjs@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 24ED91580E0 for ; Mon, 02 Jun 2025 09:51:36 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 12B67343078 for ; Mon, 02 Jun 2025 09:51:36 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 1DC26110513; Mon, 02 Jun 2025 09:48:43 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 106EC110510 for ; Mon, 02 Jun 2025 09:48:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BFED934322B for ; Mon, 02 Jun 2025 09:48:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 31B4628FC for ; Mon, 02 Jun 2025 09:48:40 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.88 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.88 Date: Mon, 02 Jun 2025 09:48:40 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 925777a7-62ea-42b5-ae9c-04d43e7917de X-Archives-Hash: 67db20ce6d686f7bd370d8607c1d7d42 Message-ID: <20250602094840.yOU-4XO-QqTG_uheGdPvXL5XZpSJrxxO_UrpITaNJ94@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3A1AF1580E0 for ; Mon, 02 Jun 2025 09:51:55 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 2873B3432E5 for ; Mon, 02 Jun 2025 09:51:55 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 9977811051F; Mon, 02 Jun 2025 09:48:44 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 8843311051B for ; Mon, 02 Jun 2025 09:48:44 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4016D34322B for ; Mon, 02 Jun 2025 09:48:44 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 5946C2822 for ; Mon, 02 Jun 2025 09:48:41 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:master commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: master Date: Mon, 02 Jun 2025 09:48:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ecafc195-f5f5-479c-85df-3a6ac58cd27b X-Archives-Hash: 10ea977920100af0020cc090ec040215 Message-ID: <20250602094841.6OWqD2NDsKXgctCKtGbSY6y8T3wGGRvSMDgbJtTEJgM@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8D1E91580E0 for ; Mon, 02 Jun 2025 09:52:31 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 79F623433D6 for ; Mon, 02 Jun 2025 09:52:31 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2970F11052D; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 22E9E11052D for ; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D5B5D343264 for ; Mon, 02 Jun 2025 09:48:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 63E9728EE for ; Mon, 02 Jun 2025 09:48:55 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.76.0-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.76.0-r101 Date: Mon, 02 Jun 2025 09:48:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ed6cd524-f315-4acc-94aa-a5e58ea8adab X-Archives-Hash: 48b12884cec95854fe00f8c35ab183c5 Message-ID: <20250602094855.pCSAfY-IXTWbkB-6GOLVhvGZ6SS6BYpzvEguUX8tOak@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 988391580E0 for ; Mon, 02 Jun 2025 09:52:39 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 8640234338A for ; Mon, 02 Jun 2025 09:52:39 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 56899110531; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 49644110531 for ; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 06477343241 for ; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B115328F2 for ; Mon, 02 Jun 2025 09:48:55 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.77.1-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.77.1-r101 Date: Mon, 02 Jun 2025 09:48:55 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ce68d8ff-b0a7-4ae3-8ad0-65469bc50be4 X-Archives-Hash: 6ac8a016923b21b42e7179827aa3f9f1 Message-ID: <20250602094855.rC_jdDEXFQkzSmA3H1xPKFEUBvNzD6Umc31KfosME34@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7A55B1580E0 for ; Mon, 02 Jun 2025 09:52:44 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 67D173433D7 for ; Mon, 02 Jun 2025 09:52:44 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 91022110537; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 88359110534 for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 476DE343263 for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1CAD828FD for ; Mon, 02 Jun 2025 09:48:56 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.78.0-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.78.0-r101 Date: Mon, 02 Jun 2025 09:48:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 820944d0-4bc6-4e08-83c7-48a81d3fc551 X-Archives-Hash: 8166d4556a19ab92e6aa624a3935e574 Message-ID: <20250602094856.3ihk8C0J60Kh_8k2zrB1k5S7OhfwZ69ThynWEKY2feg@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id DCF6F1580E0 for ; Mon, 02 Jun 2025 09:52:52 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id CC1953433F6 for ; Mon, 02 Jun 2025 09:52:52 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id CB85A11053C; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id B45E7110538 for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 732F4343266 for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8F3DA2529 for ; Mon, 02 Jun 2025 09:48:56 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.79.0-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.79.0-r101 Date: Mon, 02 Jun 2025 09:48:56 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 27aafcb7-257e-49ee-bb3f-9d7daa241885 X-Archives-Hash: a7a5a5f5ef5a7d34084aba83ce3a6cda Message-ID: <20250602094856.99WkTcdtBvvcRGJbFQfcKcfbQI_NDdxWRPbwJn_n6JY@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5C36D1580E0 for ; Mon, 02 Jun 2025 09:53:07 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4A21334340F for ; Mon, 02 Jun 2025 09:53:07 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id F1AE1110542; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id D709D11053D for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 957D434325F for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0E0452916 for ; Mon, 02 Jun 2025 09:48:57 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.80.1-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.80.1-r101 Date: Mon, 02 Jun 2025 09:48:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 35e300fc-635e-4053-9d99-9f48a4872bc7 X-Archives-Hash: a4cbd70e9299e60bd6516f224a062b89 Message-ID: <20250602094857.qml27efVZmzWeSfGrM8F_kmfGUisQ4l_tIBzc2PDOY0@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D5D8F1580E0 for ; Mon, 02 Jun 2025 09:53:17 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id BFE9D343404 for ; Mon, 02 Jun 2025 09:53:17 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2D3F81104B7; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 279EA1104B7 for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D97C934320D for ; Mon, 02 Jun 2025 09:49:00 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9419B2940 for ; Mon, 02 Jun 2025 09:48:57 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.81.0-r101 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.81.0-r101 Date: Mon, 02 Jun 2025 09:48:57 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 013d15ea-4493-4793-abde-abc7142167f8 X-Archives-Hash: d4add431b18afa0e2621898531808f08 Message-ID: <20250602094857.6d0noNSm80QM0E6UUEg4XqRznyk-gekSZbqct2DbFbM@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id EC6161580E0 for ; Mon, 02 Jun 2025 09:53:34 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id DB27B343353 for ; Mon, 02 Jun 2025 09:53:34 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7577111054B; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 5DF6C11054E for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 174FE343278 for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 236B9297C for ; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.82.0-r103 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.82.0-r103 Date: Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bd95a41a-2327-4356-85f7-a2ab40b2c1bc X-Archives-Hash: 5c7b310dada0029f10fa597af5be5fdd Message-ID: <20250602094858.dS7SpH040ywdfNSR-KfknwS33K4YO8LlWrQiuAHCU6Q@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id F13511580E0 for ; Mon, 02 Jun 2025 09:53:40 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id E082234344F for ; Mon, 02 Jun 2025 09:53:40 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 8590E110557; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 7B851110551 for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 39435343201 for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C605128F8 for ; Mon, 02 Jun 2025 09:48:58 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.83.0-r3 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.83.0-r3 Date: Mon, 02 Jun 2025 09:48:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 88693e80-84e4-4d05-9b5d-d32a0e081828 X-Archives-Hash: 822ec039d4d2baaace2abc2889596df5 Message-ID: <20250602094858.LJ6pJUzFqAMOCGc6gajQhs388NiO0VTgeSRmUxRZrsg@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 73E161580E0 for ; Mon, 02 Jun 2025 09:53:59 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 61F7D343421 for ; Mon, 02 Jun 2025 09:53:59 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id EB28B11055F; Mon, 02 Jun 2025 09:49:02 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id E1F3411055E for ; Mon, 02 Jun 2025 09:49:02 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A0AA4343273 for ; Mon, 02 Jun 2025 09:49:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7DCA32985 for ; Mon, 02 Jun 2025 09:48:59 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.84.0-r2 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.84.0-r2 Date: Mon, 02 Jun 2025 09:48:59 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: c91b132c-4209-4520-8ceb-c59fe6c0340f X-Archives-Hash: 1e64bfcec5a3a2f206cdafea86c7db1e Message-ID: <20250602094859.0Cdo7wusCPenADUaDCCuXOptp-zqrbHwnCjlv0U_kzo@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0F0771580E0 for ; Mon, 02 Jun 2025 09:54:18 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id EF9843433F9 for ; Mon, 02 Jun 2025 09:54:17 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 2FB73110569; Mon, 02 Jun 2025 09:49:03 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 1C559110568 for ; Mon, 02 Jun 2025 09:49:03 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CC41734326B for ; Mon, 02 Jun 2025 09:49:02 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 4F7E328FF for ; Mon, 02 Jun 2025 09:49:00 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.84.1-r2 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.84.1-r2 Date: Mon, 02 Jun 2025 09:49:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0b7869b5-48a7-42fa-bdd6-2c6149a3de67 X-Archives-Hash: 09ccf9eee13737dccc8b9a8f061d9a42 Message-ID: <20250602094900.GoCX8PXncdwfn9ZOXvG_bl4oJxx9IIy8TpHSPYZawBM@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 429781580E0 for ; Mon, 02 Jun 2025 09:54:36 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 2E210343438 for ; Mon, 02 Jun 2025 09:54:36 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 93515110573; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 83FCA110570 for ; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3E6BC343275 for ; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2D4002937 for ; Mon, 02 Jun 2025 09:49:01 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.85.0-r2 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.85.0-r2 Date: Mon, 02 Jun 2025 09:49:01 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: ef030d3d-09d4-4f4d-9723-7b46c5ab9764 X-Archives-Hash: 58c32b4c97654fe44da30612aabe4b7c Message-ID: <20250602094901.YV6fpIU8jHBh3RQV7PJulLppPYn_8ybjGSbcV0Y26ZU@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3BCB21580E0 for ; Mon, 02 Jun 2025 09:54:56 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 25D7934327F for ; Mon, 02 Jun 2025 09:54:56 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C8E2E110574; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id B4301110574 for ; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 70F6A34324D for ; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1CB8428F8 for ; Mon, 02 Jun 2025 09:49:02 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.85.1-r1 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.85.1-r1 Date: Mon, 02 Jun 2025 09:49:02 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 54dafb48-b6be-4fce-9f3c-8bb1e2566146 X-Archives-Hash: 8ecfca5d2c7e5bbd6e1214b037bc09d3 Message-ID: <20250602094902.imSqYlrsrcfXACY0YV0DIfbCa00wpeSf8EJubmVMivA@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 3DA5C1580E0 for ; Mon, 02 Jun 2025 09:55:28 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 8FCFC34305E for ; Mon, 02 Jun 2025 09:55:20 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 49615110589; Mon, 02 Jun 2025 09:49:06 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 35B38110586 for ; Mon, 02 Jun 2025 09:49:06 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E648434328F for ; Mon, 02 Jun 2025 09:49:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0BB7424B9 for ; Mon, 02 Jun 2025 09:49:03 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.86.0-r2 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.86.0-r2 Date: Mon, 02 Jun 2025 09:49:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: cbbd3ecd-9698-4b82-b790-e8e139cd062e X-Archives-Hash: 8cd94570c9b11af55aaf88b388a21930 Message-ID: <20250602094903.zoOyOx_sC2TT_SUsLCaF4X2sziqnZ02viQ2V5UCsPZ4@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id C00411580E0 for ; Mon, 02 Jun 2025 09:55:42 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 7B55634326A for ; Mon, 02 Jun 2025 09:55:40 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id AFA61110596; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id A3C21110593 for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 62B863431F7 for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 11B222982 for ; Mon, 02 Jun 2025 09:49:04 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.87.0-r1 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.87.0-r1 Date: Mon, 02 Jun 2025 09:49:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: dc71d136-83b6-4fb6-8715-b6fed0670574 X-Archives-Hash: 9b7e7f82eb5536aa45e71957c2fcc43e Message-ID: <20250602094904.QNcncSt5pKW_ikt8AozOq3TT69cZaTS3Idi20yroYyM@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 + From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 40C041580E0 for ; Mon, 02 Jun 2025 09:56:07 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 9431D34327B for ; Mon, 02 Jun 2025 09:56:06 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 0B2ED11059E; Mon, 02 Jun 2025 09:49:08 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id ED20A1105A1 for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id A50BD3431F7 for ; Mon, 02 Jun 2025 09:49:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2C7E328F2 for ; Mon, 02 Jun 2025 09:49:05 +0000 (UTC) From: "Matt Jolly" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Jolly" Message-ID: <1748857628.22f344960f242b45fc42a9293ac34fdf4fe5cb48.kangie@gentoo> Subject: [gentoo-commits] proj/rust-patches:1.88.0_beta20250526 commit in: / X-VCS-Repository: proj/rust-patches X-VCS-Files: 1.76.0-loong-code-model.patch X-VCS-Directories: / X-VCS-Committer: kangie X-VCS-Committer-Name: Matt Jolly X-VCS-Revision: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 X-VCS-Branch: 1.88.0_beta20250526 Date: Mon, 02 Jun 2025 09:49:05 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f47d6b2b-725c-4ba1-97c9-6ef16eaa1ab2 X-Archives-Hash: 117457ad6c4684fe32f7bb60c76e90fb Message-ID: <20250602094905.swC1YRypbQ_U5ENRs9sH-VXkv0yhxWNb43h8lORLF4Y@z> commit: 22f344960f242b45fc42a9293ac34fdf4fe5cb48 Author: Matt Jolly gentoo org> AuthorDate: Mon Jun 2 09:47:08 2025 +0000 Commit: Matt Jolly gentoo org> CommitDate: Mon Jun 2 09:47:08 2025 +0000 URL: https://gitweb.gentoo.org/proj/rust-patches.git/commit/?id=22f34496 Add patches for Rust 1.76.0-r101 Patches: - 1.67.0-doc-wasm.patch - 1.70.0-ignore-broken-and-non-applicable-tests.patch - 1.74.1-cross-compile-libz.patch - 1.81.0-backport-bug937164.patch - 1.81.0-backport-llvm-pr101761.patch - 1.81.0-backport-llvm-pr101766.patch - 1.75.0-handle-vendored-sources.patch - 1.75.0-musl-dynamic-linking.patch - 1.76.0-loong-code-model.patch Signed-off-by: Matt Jolly 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 +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 +