Compare commits
3 Commits
c8-stream-
...
a8-stream-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21b918c326 | ||
| 37feab1a87 | |||
| 79e5f55385 |
19
.gitignore
vendored
19
.gitignore
vendored
@ -1,2 +1,17 @@
|
||||
SOURCES/rustc-1.75.0-src.tar.xz
|
||||
SOURCES/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
SOURCES/rustc-1.88.0-src.tar.xz
|
||||
SOURCES/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
|
||||
SOURCES/cargo-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
SOURCES/cargo-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
SOURCES/cargo-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
SOURCES/cargo-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
SOURCES/cargo-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rust-std-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rust-std-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rust-std-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rust-std-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rust-std-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rustc-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rustc-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rustc-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rustc-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
SOURCES/rustc-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
|
||||
@ -1,2 +1,17 @@
|
||||
9ad7bb54dc9572c103b855cdcc823addbb34d15d SOURCES/rustc-1.75.0-src.tar.xz
|
||||
55eaa32c99cc8ec970f2db2d340a605724589f9b SOURCES/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
a5772a6462f53ffc71fda030bece8442d1214198 SOURCES/rustc-1.88.0-src.tar.xz
|
||||
d6330f7ed84d311d1338796af7fd60f011f3a707 SOURCES/wasi-libc-640c0cfc19a96b099e0791824be5ef0105ce2084.tar.gz
|
||||
9db2221e1661966bb075c661452db71f27b42c41 SOURCES/cargo-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
8a14006ae0e34336304190e8d9411b1061a66da4 SOURCES/cargo-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
be2b004db6f63991a61ef0c7cea9c8c5b97b10cd SOURCES/cargo-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
1ba5567a3aa425b2391682d93917e697076e2081 SOURCES/cargo-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
eacf8a939ae7a59670e885e23b6e7fe051bf01b5 SOURCES/cargo-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
e6cb528be346a3b0ee89cb6dc9d1cf926fa3307e SOURCES/rust-std-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
9d34e6af2192af000a2c1c7ea8bb7fbb2cd6bff1 SOURCES/rust-std-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
3beab8917d485941349f3142cc0a539fd89ea81a SOURCES/rust-std-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
d9e6aecdc9ea4bd767b9b4e08b8dddb7188522ab SOURCES/rust-std-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
30391afc6455cdba697c8d29926a0c83788134c5 SOURCES/rust-std-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
65b8fd98bf0881e066de71dfcf1da45ac5d20864 SOURCES/rustc-1.87.0-aarch64-unknown-linux-gnu.tar.xz
|
||||
b73832be27ac612d0ffb334c4e30e3bba949a563 SOURCES/rustc-1.87.0-i686-unknown-linux-gnu.tar.xz
|
||||
a64b055a86cf4f853dc589d9ace7ab001ab239e5 SOURCES/rustc-1.87.0-powerpc64le-unknown-linux-gnu.tar.xz
|
||||
2246258130c9a6028fe88c73217b4be50f7236cd SOURCES/rustc-1.87.0-s390x-unknown-linux-gnu.tar.xz
|
||||
7b35341d333ad5bd2f0b93ad9e8b68b1f137a347 SOURCES/rustc-1.87.0-x86_64-unknown-linux-gnu.tar.xz
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b Mon Sep 17 00:00:00 2001
|
||||
From 5273432acfae75d6e509bbebcf8d28b0f3d820d0 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Fri, 9 Jun 2023 15:23:08 -0700
|
||||
Subject: [PATCH] Let environment variables override some default CPUs
|
||||
@ -10,12 +10,12 @@ Subject: [PATCH] Let environment variables override some default CPUs
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
|
||||
index 194c3170e683..9806ca78297c 100644
|
||||
index 23913687a1fd..3253fbc84c74 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub fn target() -> Target {
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_gnu::opts();
|
||||
- base.cpu = "ppc64le".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into();
|
||||
@ -23,25 +23,25 @@ index 194c3170e683..9806ca78297c 100644
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
|
||||
index 6fc410eb2235..c8f84edb9715 100644
|
||||
index a84a18a433ff..441af1018ff3 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs
|
||||
@@ -5,7 +5,7 @@ pub fn target() -> Target {
|
||||
@@ -5,7 +5,7 @@ pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_gnu::opts();
|
||||
base.endian = Endian::Big;
|
||||
// z10 is the oldest CPU supported by LLVM
|
||||
- base.cpu = "z10".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_S390X").unwrap_or("z10").into();
|
||||
// FIXME: The ABI implementation in cabi_s390x.rs is for now hard-coded to assume the no-vector
|
||||
// ABI. Pass the -vector feature string to LLVM to respect this assumption. On LLVM < 16, we
|
||||
// also strip v128 from the data_layout below to match the older LLVM's expectation.
|
||||
base.max_atomic_width = Some(128);
|
||||
base.min_global_align = Some(16);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
|
||||
index 80e267c163fa..8436a00e66d5 100644
|
||||
index 59ec6c7f9d5f..b6f1be890b20 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
pub fn target() -> Target {
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::linux_gnu::opts();
|
||||
- base.cpu = "x86-64".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_X86_64").unwrap_or("x86-64").into();
|
||||
@ -49,5 +49,5 @@ index 80e267c163fa..8436a00e66d5 100644
|
||||
base.max_atomic_width = Some(64);
|
||||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
|
||||
--
|
||||
2.41.0
|
||||
2.47.1
|
||||
|
||||
|
||||
@ -1,19 +1,21 @@
|
||||
From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001
|
||||
From 687112c89c9058ef1e79f1c3a974940b1ae43ea3 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Wed, 1 Nov 2023 15:21:15 -0700
|
||||
Date: Fri, 16 Aug 2024 10:12:58 -0700
|
||||
Subject: [PATCH] Use lld provided by system
|
||||
|
||||
---
|
||||
compiler/rustc_target/src/spec/base/wasm.rs | 3 +--
|
||||
compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 +
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
compiler/rustc_target/src/spec/base/wasm.rs | 3 +--
|
||||
.../src/spec/targets/aarch64_unknown_none_softfloat.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs | 1 +
|
||||
compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs | 1 +
|
||||
5 files changed, 5 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
|
||||
index 87ade9e58cf4..2ddff95febab 100644
|
||||
index 81b96cd39ffa..4c9916af826b 100644
|
||||
--- a/compiler/rustc_target/src/spec/base/wasm.rs
|
||||
+++ b/compiler/rustc_target/src/spec/base/wasm.rs
|
||||
@@ -91,8 +91,7 @@ macro_rules! args {
|
||||
@@ -85,8 +85,7 @@ macro_rules! args {
|
||||
// arguments just yet
|
||||
limit_rdylib_exports: false,
|
||||
|
||||
@ -23,24 +25,49 @@ index 87ade9e58cf4..2ddff95febab 100644
|
||||
linker_flavor: LinkerFlavor::WasmLld(Cc::No),
|
||||
|
||||
pre_link_args,
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
|
||||
index 3b719ebaf07e..8b4fecee68f0 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_none_softfloat.rs
|
||||
@@ -15,7 +15,7 @@ pub(crate) fn target() -> Target {
|
||||
let opts = TargetOptions {
|
||||
abi: "softfloat".into(),
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
- linker: Some("rust-lld".into()),
|
||||
+ linker: Some("lld".into()),
|
||||
features: "+v8a,+strict-align,-neon,-fp-armv8".into(),
|
||||
relocation_model: RelocModel::Static,
|
||||
disable_redzone: true,
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
|
||||
index 9656024ddaa1..2099fa17229f 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs
|
||||
@@ -9,6 +9,7 @@ pub(crate) fn target() -> Target {
|
||||
base.max_atomic_width = Some(128);
|
||||
base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &["/machine:arm64"]);
|
||||
base.features = "+v8a".into();
|
||||
+ base.linker = Some("lld".into());
|
||||
|
||||
Target {
|
||||
llvm_target: "aarch64-unknown-windows".into(),
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
|
||||
index 9aa95a35f8e5..a9172f9441b7 100644
|
||||
index e14a36735894..b493d7d98b46 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_none.rs
|
||||
@@ -17,7 +17,7 @@ pub fn target() -> Target {
|
||||
@@ -19,7 +19,7 @@ pub(crate) fn target() -> Target {
|
||||
static_position_independent_executables: true,
|
||||
relro_level: RelroLevel::Full,
|
||||
linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes),
|
||||
- linker: Some("rust-lld".into()),
|
||||
+ linker: Some("lld".into()),
|
||||
features:
|
||||
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
|
||||
.into(),
|
||||
rustc_abi: Some(RustcAbi::X86Softfloat),
|
||||
features: "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float".into(),
|
||||
supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS,
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
|
||||
index 5abfb8162f70..13cb43bda1a4 100644
|
||||
index bce6aa0ebc6b..7fa1148a1de7 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs
|
||||
@@ -16,6 +16,7 @@ pub fn target() -> Target {
|
||||
@@ -14,6 +14,7 @@ pub(crate) fn target() -> Target {
|
||||
base.plt_by_default = false;
|
||||
base.max_atomic_width = Some(64);
|
||||
base.entry_abi = Conv::X86_64Win64;
|
||||
@ -49,5 +76,5 @@ index 5abfb8162f70..13cb43bda1a4 100644
|
||||
// We disable MMX and SSE for now, even though UEFI allows using them. Problem is, you have to
|
||||
// enable these CPU features explicitly before their first use, otherwise their instructions
|
||||
--
|
||||
2.41.0
|
||||
2.48.1
|
||||
|
||||
|
||||
@ -1,22 +1,22 @@
|
||||
From df0d6f1d8b46db82d7599ca8eff6e8f844cf52f2 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 28 Sep 2023 18:14:28 -0700
|
||||
From e8833a9032b9f5773ef891b3f12b93322d6b4950 Mon Sep 17 00:00:00 2001
|
||||
From: Jesus Checa Hidalgo <jchecahi@redhat.com>
|
||||
Date: Mon, 7 Apr 2025 16:59:10 +0200
|
||||
Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
|
||||
|
||||
---
|
||||
config.example.toml | 5 +++++
|
||||
bootstrap.example.toml | 5 +++++
|
||||
src/bootstrap/src/core/build_steps/compile.rs | 4 ++++
|
||||
src/bootstrap/src/core/config/config.rs | 8 ++++++++
|
||||
src/bootstrap/src/lib.rs | 5 +++++
|
||||
4 files changed, 22 insertions(+)
|
||||
|
||||
diff --git a/config.example.toml b/config.example.toml
|
||||
index e5df28a49af6..2fcd8b8cb057 100644
|
||||
--- a/config.example.toml
|
||||
+++ b/config.example.toml
|
||||
@@ -807,6 +807,11 @@ change-id = 116881
|
||||
# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.
|
||||
#no-std = <platform-specific> (bool)
|
||||
diff --git a/bootstrap.example.toml b/bootstrap.example.toml
|
||||
index 2a98821f225..580d6b2a8a2 100644
|
||||
--- a/bootstrap.example.toml
|
||||
+++ b/bootstrap.example.toml
|
||||
@@ -948,6 +948,11 @@
|
||||
# This overrides the global `rust.jemalloc` option. See that option for more info.
|
||||
#jemalloc = rust.jemalloc (bool)
|
||||
|
||||
+# Copy libc and CRT objects into the target lib/self-contained/ directory.
|
||||
+# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
|
||||
@ -27,10 +27,10 @@ index e5df28a49af6..2fcd8b8cb057 100644
|
||||
# Distribution options
|
||||
#
|
||||
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
|
||||
index 7021a9543582..11555c65ca87 100644
|
||||
index 18b5d4426b1..3de9667123b 100644
|
||||
--- a/src/bootstrap/src/core/build_steps/compile.rs
|
||||
+++ b/src/bootstrap/src/core/build_steps/compile.rs
|
||||
@@ -302,6 +302,10 @@ fn copy_self_contained_objects(
|
||||
@@ -370,6 +370,10 @@ fn copy_self_contained_objects(
|
||||
compiler: &Compiler,
|
||||
target: TargetSelection,
|
||||
) -> Vec<(PathBuf, DependencyType)> {
|
||||
@ -38,24 +38,24 @@ index 7021a9543582..11555c65ca87 100644
|
||||
+ return vec![];
|
||||
+ }
|
||||
+
|
||||
let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained");
|
||||
let libdir_self_contained =
|
||||
builder.sysroot_target_libdir(*compiler, target).join("self-contained");
|
||||
t!(fs::create_dir_all(&libdir_self_contained));
|
||||
let mut target_deps = vec![];
|
||||
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
|
||||
index 0a9175aa3ea5..a2e028b25036 100644
|
||||
index bbb0fbfbb93..8642a86cbf8 100644
|
||||
--- a/src/bootstrap/src/core/config/config.rs
|
||||
+++ b/src/bootstrap/src/core/config/config.rs
|
||||
@@ -533,6 +533,7 @@ pub struct Target {
|
||||
pub wasi_root: Option<PathBuf>,
|
||||
pub qemu_rootfs: Option<PathBuf>,
|
||||
pub no_std: bool,
|
||||
@@ -666,6 +666,7 @@ pub struct Target {
|
||||
pub codegen_backends: Option<Vec<String>>,
|
||||
pub optimized_compiler_builtins: Option<bool>,
|
||||
pub jemalloc: Option<bool>,
|
||||
+ pub self_contained: bool,
|
||||
}
|
||||
|
||||
impl Target {
|
||||
@@ -541,6 +542,9 @@ pub fn from_triple(triple: &str) -> Self {
|
||||
if triple.contains("-none") || triple.contains("nvptx") || triple.contains("switch") {
|
||||
target.no_std = true;
|
||||
@@ -677,6 +678,9 @@ pub fn from_triple(triple: &str) -> Self {
|
||||
if triple.contains("emscripten") {
|
||||
target.runner = Some("node".into());
|
||||
}
|
||||
+ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
|
||||
+ target.self_contained = true;
|
||||
@ -63,15 +63,15 @@ index 0a9175aa3ea5..a2e028b25036 100644
|
||||
target
|
||||
}
|
||||
}
|
||||
@@ -1051,6 +1055,7 @@ struct TomlTarget {
|
||||
wasi_root: Option<String> = "wasi-root",
|
||||
qemu_rootfs: Option<String> = "qemu-rootfs",
|
||||
no_std: Option<bool> = "no-std",
|
||||
@@ -1292,6 +1296,7 @@ struct TomlTarget {
|
||||
runner: Option<String> = "runner",
|
||||
optimized_compiler_builtins: Option<bool> = "optimized-compiler-builtins",
|
||||
jemalloc: Option<bool> = "jemalloc",
|
||||
+ self_contained: Option<bool> = "self-contained",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1600,6 +1605,9 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
||||
@@ -2245,6 +2250,9 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
||||
if let Some(s) = cfg.no_std {
|
||||
target.no_std = s;
|
||||
}
|
||||
@ -82,10 +82,10 @@ index 0a9175aa3ea5..a2e028b25036 100644
|
||||
target.cxx = cfg.cxx.map(PathBuf::from);
|
||||
target.ar = cfg.ar.map(PathBuf::from);
|
||||
diff --git a/src/bootstrap/src/lib.rs b/src/bootstrap/src/lib.rs
|
||||
index 33b8f1a7ce72..f36e53187576 100644
|
||||
index 843d474f92d..3a4398ee1f8 100644
|
||||
--- a/src/bootstrap/src/lib.rs
|
||||
+++ b/src/bootstrap/src/lib.rs
|
||||
@@ -1335,6 +1335,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
|
||||
@@ -1434,6 +1434,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
|
||||
self.config.target_config.get(&target).map(|t| t.no_std)
|
||||
}
|
||||
|
||||
@ -98,5 +98,5 @@ index 33b8f1a7ce72..f36e53187576 100644
|
||||
/// and `remote-test-server` binaries.
|
||||
fn remote_tested(&self, target: TargetSelection) -> bool {
|
||||
--
|
||||
2.41.0
|
||||
2.48.1
|
||||
|
||||
|
||||
@ -1,33 +0,0 @@
|
||||
From 776146e9ebb6bbe17a37bfad955f3dac95317275 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 16 Nov 2023 10:42:23 -0800
|
||||
Subject: [PATCH] bootstrap: only show PGO warnings when verbose
|
||||
|
||||
Building rustc with `--rust-profile-use` is currently dumping a lot of
|
||||
warnings of "no profile data available for function" from `rustc_smir`
|
||||
and `stable_mir`. These simply aren't exercised by the current profile-
|
||||
gathering steps, but that's to be expected for new or experimental
|
||||
functionality. I think for most people, these warnings will be just
|
||||
noise, so it makes sense to only have them in verbose builds.
|
||||
---
|
||||
src/bootstrap/src/core/build_steps/compile.rs | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
|
||||
index af69860df1c5..51e4195827fc 100644
|
||||
--- a/src/bootstrap/src/core/build_steps/compile.rs
|
||||
+++ b/src/bootstrap/src/core/build_steps/compile.rs
|
||||
@@ -887,7 +887,9 @@ fn run(self, builder: &Builder<'_>) {
|
||||
} else if let Some(path) = &builder.config.rust_profile_use {
|
||||
if compiler.stage == 1 {
|
||||
cargo.rustflag(&format!("-Cprofile-use={path}"));
|
||||
- cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
|
||||
+ if builder.is_verbose() {
|
||||
+ cargo.rustflag("-Cllvm-args=-pgo-warn-missing-function");
|
||||
+ }
|
||||
true
|
||||
} else {
|
||||
false
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@ -1,19 +1,20 @@
|
||||
From 79bb610c8fc5d9df7dd4720ae847b8f17e7b1ad4 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 28 Sep 2023 18:18:16 -0700
|
||||
From 35a37bd892939b8a1cd194632de3b9dd3a3d479b Mon Sep 17 00:00:00 2001
|
||||
From: Jesus Checa Hidalgo <jchecahi@redhat.com>
|
||||
Date: Mon, 7 Apr 2025 17:22:56 +0200
|
||||
Subject: [PATCH 2/2] set an external library path for wasm32-wasi
|
||||
|
||||
---
|
||||
compiler/rustc_codegen_ssa/src/back/link.rs | 9 +++++++++
|
||||
compiler/rustc_target/src/spec/mod.rs | 2 ++
|
||||
compiler/rustc_target/src/spec/targets/wasm32_wasi.rs | 6 +++++-
|
||||
3 files changed, 16 insertions(+), 1 deletion(-)
|
||||
compiler/rustc_codegen_ssa/src/back/link.rs | 10 ++++++++++
|
||||
compiler/rustc_target/src/spec/json.rs | 2 ++
|
||||
compiler/rustc_target/src/spec/mod.rs | 2 ++
|
||||
.../rustc_target/src/spec/targets/wasm32_wasip1.rs | 7 ++++---
|
||||
4 files changed, 18 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
index dd9d277fb775..3d0f0502f255 100644
|
||||
index b59d73a9aae..2369d73b4e3 100644
|
||||
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
@@ -1496,6 +1496,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
|
||||
@@ -1583,6 +1583,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
|
||||
return file_path;
|
||||
}
|
||||
}
|
||||
@ -23,24 +24,45 @@ index dd9d277fb775..3d0f0502f255 100644
|
||||
+ return file_path;
|
||||
+ }
|
||||
+ }
|
||||
for search_path in fs.search_paths() {
|
||||
for search_path in sess.target_filesearch().search_paths(PathKind::Native) {
|
||||
let file_path = search_path.dir.join(name);
|
||||
if file_path.exists() {
|
||||
@@ -1982,6 +1988,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
|
||||
let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
|
||||
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
|
||||
}
|
||||
@@ -2140,6 +2146,10 @@ fn add_library_search_dirs(
|
||||
}
|
||||
ControlFlow::<()>::Continue(())
|
||||
});
|
||||
+
|
||||
+ if let Some(lib_path) = &sess.target.options.external_lib_path {
|
||||
+ cmd.include_path(Path::new(lib_path.as_ref()));
|
||||
+ }
|
||||
}
|
||||
|
||||
/// Add options making relocation sections in the produced ELF files read-only
|
||||
diff --git a/compiler/rustc_target/src/spec/json.rs b/compiler/rustc_target/src/spec/json.rs
|
||||
index 4b6de5e18f5..373301d85ab 100644
|
||||
--- a/compiler/rustc_target/src/spec/json.rs
|
||||
+++ b/compiler/rustc_target/src/spec/json.rs
|
||||
@@ -559,6 +559,7 @@ macro_rules! key {
|
||||
key!(linker_is_gnu_json = "linker-is-gnu", bool);
|
||||
key!(pre_link_objects = "pre-link-objects", link_objects);
|
||||
key!(post_link_objects = "post-link-objects", link_objects);
|
||||
+ key!(external_lib_path, optional);
|
||||
key!(pre_link_objects_self_contained = "pre-link-objects-fallback", link_objects);
|
||||
key!(post_link_objects_self_contained = "post-link-objects-fallback", link_objects);
|
||||
// Deserializes the backwards-compatible variants of `-Clink-self-contained`
|
||||
@@ -744,6 +745,7 @@ macro_rules! target_option_val {
|
||||
target_option_val!(linker_is_gnu_json, "linker-is-gnu");
|
||||
target_option_val!(pre_link_objects);
|
||||
target_option_val!(post_link_objects);
|
||||
+ target_option_val!(external_lib_path);
|
||||
target_option_val!(pre_link_objects_self_contained, "pre-link-objects-fallback");
|
||||
target_option_val!(post_link_objects_self_contained, "post-link-objects-fallback");
|
||||
target_option_val!(link_args - pre_link_args_json, "pre-link-args");
|
||||
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
|
||||
index f04799482c83..25410b37ba24 100644
|
||||
index 7234d1dc63e..3ec85bbf279 100644
|
||||
--- a/compiler/rustc_target/src/spec/mod.rs
|
||||
+++ b/compiler/rustc_target/src/spec/mod.rs
|
||||
@@ -1874,6 +1874,7 @@ pub struct TargetOptions {
|
||||
@@ -2301,6 +2301,7 @@ pub struct TargetOptions {
|
||||
/// Objects to link before and after all other object code.
|
||||
pub pre_link_objects: CrtObjects,
|
||||
pub post_link_objects: CrtObjects,
|
||||
@ -48,7 +70,7 @@ index f04799482c83..25410b37ba24 100644
|
||||
/// Same as `(pre|post)_link_objects`, but when self-contained linking mode is enabled.
|
||||
pub pre_link_objects_self_contained: CrtObjects,
|
||||
pub post_link_objects_self_contained: CrtObjects,
|
||||
@@ -2352,6 +2353,7 @@ fn default() -> TargetOptions {
|
||||
@@ -2821,6 +2822,7 @@ fn default() -> TargetOptions {
|
||||
relro_level: RelroLevel::None,
|
||||
pre_link_objects: Default::default(),
|
||||
post_link_objects: Default::default(),
|
||||
@ -56,23 +78,26 @@ index f04799482c83..25410b37ba24 100644
|
||||
pre_link_objects_self_contained: Default::default(),
|
||||
post_link_objects_self_contained: Default::default(),
|
||||
link_self_contained: LinkSelfContainedDefault::False,
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
|
||||
index 6dbcb01ea436..2151f86d0648 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasi.rs
|
||||
@@ -86,7 +86,11 @@ pub fn target() -> Target {
|
||||
options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
|
||||
diff --git a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
|
||||
index 26add451ed2..3eaf050e682 100644
|
||||
--- a/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
|
||||
+++ b/compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs
|
||||
@@ -21,11 +21,12 @@ pub(crate) fn target() -> Target {
|
||||
options.env = "p1".into();
|
||||
options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &["--target=wasm32-wasip1"]);
|
||||
|
||||
- options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained();
|
||||
- options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained();
|
||||
+ options.pre_link_objects = crt_objects::pre_wasi_self_contained();
|
||||
+ options.post_link_objects = crt_objects::post_wasi_self_contained();
|
||||
|
||||
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
|
||||
- options.link_self_contained = LinkSelfContainedDefault::True;
|
||||
+ options.link_self_contained = LinkSelfContainedDefault::False;
|
||||
+
|
||||
+ options.pre_link_objects = options.pre_link_objects_self_contained.clone();
|
||||
+ options.post_link_objects = options.post_link_objects_self_contained.clone();
|
||||
+ options.external_lib_path = Some("/usr/wasm32-wasi/lib/wasm32-wasi".into());
|
||||
|
||||
// Right now this is a bit of a workaround but we're currently saying that
|
||||
// the target by default has a static crt which we're taking as a signal
|
||||
--
|
||||
2.41.0
|
||||
2.48.1
|
||||
|
||||
|
||||
2
SOURCES/cargo_vendor.attr
Normal file
2
SOURCES/cargo_vendor.attr
Normal file
@ -0,0 +1,2 @@
|
||||
%__cargo_vendor_path ^%{_defaultlicensedir}(/[^/]+)+/cargo-vendor.txt$
|
||||
%__cargo_vendor_provides %{_rpmconfigdir}/cargo_vendor.prov
|
||||
127
SOURCES/cargo_vendor.prov
Executable file
127
SOURCES/cargo_vendor.prov
Executable file
@ -0,0 +1,127 @@
|
||||
#! /usr/bin/python3 -s
|
||||
# Stripped down replacement for cargo2rpm parse-vendor-manifest
|
||||
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
from typing import Optional
|
||||
|
||||
|
||||
VERSION_REGEX = re.compile(
|
||||
r"""
|
||||
^
|
||||
(?P<major>0|[1-9]\d*)
|
||||
\.(?P<minor>0|[1-9]\d*)
|
||||
\.(?P<patch>0|[1-9]\d*)
|
||||
(?:-(?P<pre>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?
|
||||
(?:\+(?P<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$
|
||||
""",
|
||||
re.VERBOSE,
|
||||
)
|
||||
|
||||
|
||||
class Version:
|
||||
"""
|
||||
Version that adheres to the "semantic versioning" format.
|
||||
"""
|
||||
|
||||
def __init__(self, major: int, minor: int, patch: int, pre: Optional[str] = None, build: Optional[str] = None):
|
||||
self.major: int = major
|
||||
self.minor: int = minor
|
||||
self.patch: int = patch
|
||||
self.pre: Optional[str] = pre
|
||||
self.build: Optional[str] = build
|
||||
|
||||
@staticmethod
|
||||
def parse(version: str) -> "Version":
|
||||
"""
|
||||
Parses a version string and return a `Version` object.
|
||||
Raises a `ValueError` if the string does not match the expected format.
|
||||
"""
|
||||
|
||||
match = VERSION_REGEX.match(version)
|
||||
if not match:
|
||||
raise ValueError(f"Invalid version: {version!r}")
|
||||
|
||||
matches = match.groupdict()
|
||||
|
||||
major_str = matches["major"]
|
||||
minor_str = matches["minor"]
|
||||
patch_str = matches["patch"]
|
||||
pre = matches["pre"]
|
||||
build = matches["build"]
|
||||
|
||||
major = int(major_str)
|
||||
minor = int(minor_str)
|
||||
patch = int(patch_str)
|
||||
|
||||
return Version(major, minor, patch, pre, build)
|
||||
|
||||
def to_rpm(self) -> str:
|
||||
"""
|
||||
Formats the `Version` object as an equivalent RPM version string.
|
||||
Characters that are invalid in RPM versions are replaced ("-" -> "_")
|
||||
|
||||
Build metadata (the optional `Version.build` attribute) is dropped, so
|
||||
the conversion is not lossless for versions where this attribute is not
|
||||
`None`. However, build metadata is not intended to be part of the
|
||||
version (and is not even considered when doing version comparison), so
|
||||
dropping it when converting to the RPM version format is correct.
|
||||
"""
|
||||
|
||||
s = f"{self.major}.{self.minor}.{self.patch}"
|
||||
if self.pre:
|
||||
s += f"~{self.pre.replace('-', '_')}"
|
||||
return s
|
||||
|
||||
|
||||
def break_the_build(error: str):
|
||||
"""
|
||||
This function writes a string that is an invalid RPM dependency specifier,
|
||||
which causes dependency generators to fail and break the build. The
|
||||
additional error message is printed to stderr.
|
||||
"""
|
||||
|
||||
print("*** FATAL ERROR ***")
|
||||
print(error, file=sys.stderr)
|
||||
|
||||
|
||||
def get_cargo_vendor_txt_paths_from_stdin() -> set[str]: # pragma nocover
|
||||
"""
|
||||
Read lines from standard input and filter out lines that look like paths
|
||||
to `cargo-vendor.txt` files. This is how RPM generators pass lists of files.
|
||||
"""
|
||||
|
||||
lines = {line.rstrip("\n") for line in sys.stdin.readlines()}
|
||||
return {line for line in lines if line.endswith("/cargo-vendor.txt")}
|
||||
|
||||
|
||||
def action_parse_vendor_manifest():
|
||||
paths = get_cargo_vendor_txt_paths_from_stdin()
|
||||
|
||||
for path in paths:
|
||||
with open(path) as file:
|
||||
manifest = file.read()
|
||||
|
||||
for line in manifest.strip().splitlines():
|
||||
crate, version = line.split(" v")
|
||||
print(f"bundled(crate({crate})) = {Version.parse(version).to_rpm()}")
|
||||
|
||||
|
||||
def main():
|
||||
try:
|
||||
action_parse_vendor_manifest()
|
||||
exit(0)
|
||||
|
||||
# print an error message that is not a valid RPM dependency
|
||||
# to cause the generator to break the build
|
||||
except (IOError, ValueError) as exc:
|
||||
break_the_build(str(exc))
|
||||
exit(1)
|
||||
|
||||
break_the_build("Uncaught exception: This should not happen, please report a bug.")
|
||||
exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -1,12 +1,7 @@
|
||||
# Explicitly use bindir tools, in case others are in the PATH,
|
||||
# like the rustup shims in a user's ~/.cargo/bin/.
|
||||
#
|
||||
# Since cargo 1.31, install only uses $CARGO_HOME/config, ignoring $PWD.
|
||||
# https://github.com/rust-lang/cargo/issues/6397
|
||||
# But we can set CARGO_HOME locally, which is a good idea anyway to make sure
|
||||
# it never writes to ~/.cargo during rpmbuild.
|
||||
%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
|
||||
# __rustc: path to the default rustc executable
|
||||
%__rustc /usr/bin/rustc
|
||||
|
||||
# __rustdoc: path to the default rustdoc executable
|
||||
%__rustdoc /usr/bin/rustdoc
|
||||
|
||||
# rustflags_opt_level: default optimization level
|
||||
@ -40,20 +35,54 @@
|
||||
-Copt-level=%rustflags_opt_level
|
||||
-Cdebuginfo=%rustflags_debuginfo
|
||||
-Ccodegen-units=%rustflags_codegen_units
|
||||
-Cstrip=none
|
||||
}
|
||||
|
||||
# __cargo: cargo command with environment variables
|
||||
#
|
||||
# CARGO_HOME: This ensures cargo reads configuration file from .cargo/config.toml,
|
||||
# and prevents writing any files to $HOME during RPM builds.
|
||||
%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
|
||||
|
||||
# __cargo_common_opts: common command line flags for cargo
|
||||
#
|
||||
# _smp_mflags: run builds and tests in parallel
|
||||
%__cargo_common_opts %{?_smp_mflags}
|
||||
|
||||
%cargo_prep(V:) (\
|
||||
%{__mkdir} -p .cargo \
|
||||
cat > .cargo/config << EOF \
|
||||
# cargo_prep: macro to set up build environment for cargo projects
|
||||
#
|
||||
# This involves four steps:
|
||||
# - create the ".cargo" directory if it doesn't exist yet
|
||||
# - dump custom cargo configuration into ".cargo/config.toml"
|
||||
# - remove "Cargo.lock" if it exists (it breaks builds with custom cargo config)
|
||||
# - remove "Cargo.toml.orig" if it exists (it breaks running "cargo package")
|
||||
#
|
||||
# Options:
|
||||
# -V <number> - unpack and use vendored sources from Source<number> tarball
|
||||
# (deprecated; use -v instead)
|
||||
# -v <directory> - use vendored sources from <directory>
|
||||
# -N - Don't set up any registry. Only set up the build configuration.
|
||||
%cargo_prep(V:v:N)\
|
||||
%{-v:%{-V:%{error:-v and -V are mutually exclusive!}}}\
|
||||
%{-v:%{-N:%{error:-v and -N are mutually exclusive!}}}\
|
||||
(\
|
||||
set -euo pipefail\
|
||||
%{__mkdir} -p target/rpm\
|
||||
/usr/bin/ln -s rpm target/release\
|
||||
%{__rm} -rf .cargo/\
|
||||
%{__mkdir} -p .cargo\
|
||||
cat > .cargo/config.toml << EOF\
|
||||
[build]\
|
||||
rustc = "%{__rustc}"\
|
||||
rustdoc = "%{__rustdoc}"\
|
||||
\
|
||||
[profile.rpm]\
|
||||
inherits = "release"\
|
||||
opt-level = %{rustflags_opt_level}\
|
||||
codegen-units = %{rustflags_codegen_units}\
|
||||
debug = %{rustflags_debuginfo}\
|
||||
strip = "none"\
|
||||
\
|
||||
[env]\
|
||||
CFLAGS = "%{build_cflags}"\
|
||||
CXXFLAGS = "%{build_cxxflags}"\
|
||||
@ -65,27 +94,28 @@ root = "%{buildroot}%{_prefix}"\
|
||||
[term]\
|
||||
verbose = true\
|
||||
EOF\
|
||||
%if 0%{-V:1}\
|
||||
%{__tar} -xoaf %{S:%{-V*}}\
|
||||
cat >> .cargo/config << EOF \
|
||||
%{-V:%{__tar} -xoaf %{S:%{-V*}}}\
|
||||
%{!?-N:\
|
||||
cat >> .cargo/config.toml << EOF\
|
||||
[source.vendored-sources]\
|
||||
directory = "%{-v*}%{-V:./vendor}"\
|
||||
\
|
||||
[source.crates-io]\
|
||||
registry = "https://crates.io"\
|
||||
replace-with = "vendored-sources"\
|
||||
\
|
||||
[source.vendored-sources]\
|
||||
directory = "./vendor"\
|
||||
EOF\
|
||||
%endif\
|
||||
EOF}\
|
||||
%{__rm} -f Cargo.toml.orig\
|
||||
)
|
||||
|
||||
# __cargo_parse_opts: function-like macro which parses common flags into the
|
||||
# equivalent command-line flags for cargo
|
||||
%__cargo_parse_opts(naf:) %{shrink:\
|
||||
%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
|
||||
%{-n:--no-default-features} \
|
||||
%{-a:--all-features} \
|
||||
%{-f:--features %{-f*}} \
|
||||
%{nil}
|
||||
%{-n:%{-a:%{error:Can't specify both -n and -a}}} \
|
||||
%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
|
||||
%{-n:--no-default-features} \
|
||||
%{-a:--all-features} \
|
||||
%{-f:--features %{-f*}} \
|
||||
%{nil} \
|
||||
}
|
||||
|
||||
# NB: cargo_build/test/install do not use the -n/-a/-f argument parsing like
|
||||
@ -94,11 +124,11 @@ EOF\
|
||||
# explicitly use --no-default-features, --all-features, or --features XYZ.
|
||||
|
||||
# cargo_build: builds the crate with cargo
|
||||
%cargo_build \
|
||||
%{shrink:\
|
||||
%{__cargo} build \
|
||||
%{__cargo_common_opts} \
|
||||
--release \
|
||||
%cargo_build\
|
||||
%{shrink: \
|
||||
%{__cargo} build \
|
||||
%{__cargo_common_opts} \
|
||||
--profile rpm \
|
||||
}
|
||||
|
||||
# cargo_test: runs the test suite with cargo
|
||||
@ -108,12 +138,12 @@ EOF\
|
||||
# "cargo test" argument parsing need to be bypassed,
|
||||
# i.e. "%%cargo_test -- --skip foo" for skipping all tests with names that
|
||||
# match "foo".
|
||||
%cargo_test \
|
||||
%{shrink:\
|
||||
%{__cargo} test \
|
||||
%{__cargo_common_opts} \
|
||||
--release \
|
||||
--no-fail-fast \
|
||||
%cargo_test\
|
||||
%{shrink: \
|
||||
%{__cargo} test \
|
||||
%{__cargo_common_opts} \
|
||||
--profile rpm \
|
||||
--no-fail-fast \
|
||||
}
|
||||
|
||||
# cargo_install: install files into the buildroot
|
||||
@ -123,13 +153,14 @@ EOF\
|
||||
# "$CARGO_HOME/.crates.toml" file, which is used to keep track of which version
|
||||
# of a specific binary has been installed, but which conflicts between builds
|
||||
# of different Rust applications and is not needed when building RPM packages.
|
||||
%cargo_install \
|
||||
%cargo_install\
|
||||
%{shrink: \
|
||||
%{__cargo} install \
|
||||
%{__cargo_common_opts} \
|
||||
--profile rpm \
|
||||
--no-track \
|
||||
--path . \
|
||||
} \
|
||||
}
|
||||
|
||||
# cargo_license: print license information for all crate dependencies
|
||||
#
|
||||
@ -145,19 +176,21 @@ EOF\
|
||||
# The "cargo tree" command called by this macro will fail if there are missing
|
||||
# (optional) dependencies.
|
||||
%cargo_license(naf:)\
|
||||
%{shrink:\
|
||||
(\
|
||||
set -euo pipefail\
|
||||
%{shrink: \
|
||||
%{__cargo} tree \
|
||||
--workspace \
|
||||
--offline \
|
||||
--edges no-build,no-dev,no-proc-macro \
|
||||
--no-dedupe \
|
||||
--target all \
|
||||
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
|
||||
--prefix none \
|
||||
--format "{l}: {p}" \
|
||||
| sed -e "s: ($(pwd)[^)]*)::g" -e "s: / :/:g" -e "s:/: OR :g" \
|
||||
| sort -u
|
||||
}
|
||||
| sort -u \
|
||||
}\
|
||||
)
|
||||
|
||||
# cargo_license_summary: print license summary for all crate dependencies
|
||||
#
|
||||
@ -166,16 +199,46 @@ EOF\
|
||||
# in the dependency tree. This is useful for determining the correct License
|
||||
# tag for packages that contain compiled Rust binaries.
|
||||
%cargo_license_summary(naf:)\
|
||||
%{shrink:\
|
||||
(\
|
||||
set -euo pipefail\
|
||||
%{shrink: \
|
||||
%{__cargo} tree \
|
||||
--workspace \
|
||||
--offline \
|
||||
--edges no-build,no-dev,no-proc-macro \
|
||||
--no-dedupe \
|
||||
--target all \
|
||||
%{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
|
||||
--prefix none \
|
||||
--format "# {l}" \
|
||||
| sed -e "s: / :/:g" -e "s:/: OR :g" \
|
||||
| sort -u \
|
||||
}
|
||||
}\
|
||||
)
|
||||
|
||||
# cargo_vendor_manifest: write list of vendored crates and their versions
|
||||
#
|
||||
# The arguments for the internal "cargo tree" call emulate the logic
|
||||
# that determines which crates are included when running "cargo vendor".
|
||||
# The results are written to "cargo-vendor.txt".
|
||||
#
|
||||
# TODO: --all-features may be overly broad; this should be modified to
|
||||
# use %%__cargo_parse_opts to handle feature flags.
|
||||
%cargo_vendor_manifest()\
|
||||
(\
|
||||
set -euo pipefail\
|
||||
%{shrink: \
|
||||
%{__cargo} tree \
|
||||
--workspace \
|
||||
--offline \
|
||||
--edges normal,build \
|
||||
--no-dedupe \
|
||||
--all-features \
|
||||
--prefix none \
|
||||
--format "{p}" \
|
||||
| grep -v "$(pwd)" \
|
||||
| sed -e "s: (proc-macro)::" \
|
||||
| sort -u \
|
||||
> cargo-vendor.txt \
|
||||
}\
|
||||
)
|
||||
|
||||
|
||||
79
SOURCES/rust-pr142047.patch
Normal file
79
SOURCES/rust-pr142047.patch
Normal file
@ -0,0 +1,79 @@
|
||||
From 925e76167ce2465c5c9d990d97c2db99f459640b Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Wed, 4 Jun 2025 15:03:19 -0700
|
||||
Subject: [PATCH 1/2] Ensure stack in `ThirBuildCx::mirror_exprs`
|
||||
|
||||
This solve a stack overflow found on Fedora s390x when building
|
||||
`tests/ui/parser/survive-peano-lesson-queue.rs`. Note that the singular
|
||||
`mirror_expr` method already has this stack check, but in this case the
|
||||
plural method was the one recursing too deeply.
|
||||
---
|
||||
compiler/rustc_mir_build/src/thir/cx/expr.rs | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/compiler/rustc_mir_build/src/thir/cx/expr.rs b/compiler/rustc_mir_build/src/thir/cx/expr.rs
|
||||
index 226dc920a496c..78c168778ac9d 100644
|
||||
--- a/compiler/rustc_mir_build/src/thir/cx/expr.rs
|
||||
+++ b/compiler/rustc_mir_build/src/thir/cx/expr.rs
|
||||
@@ -38,7 +38,10 @@ impl<'tcx> ThirBuildCx<'tcx> {
|
||||
}
|
||||
|
||||
pub(crate) fn mirror_exprs(&mut self, exprs: &'tcx [hir::Expr<'tcx>]) -> Box<[ExprId]> {
|
||||
- exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect()
|
||||
+ // `mirror_exprs` may also recurse deeply, so it needs protection from stack overflow.
|
||||
+ // Note that we *could* forward to `mirror_expr` for that, but we can consolidate the
|
||||
+ // overhead of stack growth by doing it outside the iteration.
|
||||
+ ensure_sufficient_stack(|| exprs.iter().map(|expr| self.mirror_expr_inner(expr)).collect())
|
||||
}
|
||||
|
||||
#[instrument(level = "trace", skip(self, hir_expr))]
|
||||
|
||||
From af2a85bd75c011fb3453a4963400918e096e1896 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Wed, 4 Jun 2025 15:16:38 -0700
|
||||
Subject: [PATCH 2/2] Ensure stack in `Parser::parse_ty`
|
||||
|
||||
This solve a stack overflow found on Fedora s390x when building
|
||||
`tests/ui/associated-consts/issue-93775.rs`.
|
||||
---
|
||||
compiler/rustc_parse/src/parser/ty.rs | 20 ++++++++++++--------
|
||||
1 file changed, 12 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_parse/src/parser/ty.rs b/compiler/rustc_parse/src/parser/ty.rs
|
||||
index 17481731b1107..6eaec2e29ad48 100644
|
||||
--- a/compiler/rustc_parse/src/parser/ty.rs
|
||||
+++ b/compiler/rustc_parse/src/parser/ty.rs
|
||||
@@ -7,6 +7,7 @@ use rustc_ast::{
|
||||
Pinnedness, PolyTraitRef, PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty,
|
||||
TyKind, UnsafeBinderTy,
|
||||
};
|
||||
+use rustc_data_structures::stack::ensure_sufficient_stack;
|
||||
use rustc_errors::{Applicability, Diag, PResult};
|
||||
use rustc_span::{ErrorGuaranteed, Ident, Span, kw, sym};
|
||||
use thin_vec::{ThinVec, thin_vec};
|
||||
@@ -104,14 +105,17 @@ fn can_begin_dyn_bound_in_edition_2015(t: &Token) -> bool {
|
||||
impl<'a> Parser<'a> {
|
||||
/// Parses a type.
|
||||
pub fn parse_ty(&mut self) -> PResult<'a, P<Ty>> {
|
||||
- self.parse_ty_common(
|
||||
- AllowPlus::Yes,
|
||||
- AllowCVariadic::No,
|
||||
- RecoverQPath::Yes,
|
||||
- RecoverReturnSign::Yes,
|
||||
- None,
|
||||
- RecoverQuestionMark::Yes,
|
||||
- )
|
||||
+ // Make sure deeply nested types don't overflow the stack.
|
||||
+ ensure_sufficient_stack(|| {
|
||||
+ self.parse_ty_common(
|
||||
+ AllowPlus::Yes,
|
||||
+ AllowCVariadic::No,
|
||||
+ RecoverQPath::Yes,
|
||||
+ RecoverReturnSign::Yes,
|
||||
+ None,
|
||||
+ RecoverQuestionMark::Yes,
|
||||
+ )
|
||||
+ })
|
||||
}
|
||||
|
||||
pub(super) fn parse_ty_with_generics_recovery(
|
||||
@ -1,42 +0,0 @@
|
||||
--- ./rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-11-12 12:24:35.000000000 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-11-14 17:01:32.010125953 -0800
|
||||
@@ -2027,7 +2027,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2060,20 +2059,6 @@
|
||||
]
|
||||
|
||||
[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.3.0"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "2dc8a030b787e2119a731f1951d6a773e2280c660f8ec4b0f5e1505a386e71ee"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
-
|
||||
-[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.9"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- ./rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2023-11-14 17:01:32.010125953 -0800
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-11-14 17:02:44.645097701 -0800
|
||||
@@ -40,7 +40,7 @@
|
||||
curl-sys = "0.4.68"
|
||||
filetime = "0.2.22"
|
||||
flate2 = { version = "1.0.28", default-features = false, features = ["zlib"] }
|
||||
-git2 = "0.18.1"
|
||||
+git2 = { version = "0.18.1", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.19.0"
|
||||
gix = { version = "0.55.2", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "revision"] }
|
||||
gix-features-for-configuration-only = { version = "0.35.0", package = "gix-features", features = [ "parallel" ] }
|
||||
44
SOURCES/rustc-1.88.0-disable-libssh2.patch
Normal file
44
SOURCES/rustc-1.88.0-disable-libssh2.patch
Normal file
@ -0,0 +1,44 @@
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-06-13 15:47:08.609927319 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-06-13 15:47:54.463092386 -0700
|
||||
@@ -2530,7 +2530,6 @@ checksum = "e1a117465e7e1597e8febea8bb0c
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2576,20 +2575,6 @@ dependencies = [
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
-
|
||||
-[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.3.1"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "220e4f05ad4a218192533b300327f5150e809b54c4ec83b5a1d91833601811b9"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
|
||||
[[package]]
|
||||
name = "libz-rs-sys"
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-06-13 15:47:08.610402846 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-06-13 15:47:51.696071356 -0700
|
||||
@@ -46,7 +46,7 @@ curl = "0.4.47"
|
||||
curl-sys = "0.4.79"
|
||||
filetime = "0.2.25"
|
||||
flate2 = { version = "1.1.1", default-features = false, features = ["zlib-rs"] }
|
||||
-git2 = "0.20.0"
|
||||
+git2 = { version = "0.20.0", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.21.0"
|
||||
# When updating this, also see if `gix-transport` further down needs updating or some auth-related tests will fail.
|
||||
gix = { version = "0.71.0", default-features = false, features = ["blocking-http-transport-curl", "progress-tree", "parallel", "dirwalk"] }
|
||||
23
SOURCES/rustc-1.88.0-unbundle-sqlite.patch
Normal file
23
SOURCES/rustc-1.88.0-unbundle-sqlite.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.lock.orig rustc-beta-src/src/tools/cargo/Cargo.lock
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2025-06-13 01:10:18.000000000 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2025-06-13 15:39:38.597882622 -0700
|
||||
@@ -2573,7 +2573,6 @@ version = "0.32.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fbb8270bb4060bd76c6e96f20c52d80620f1d82a3470885694e41e0f81ef6fe7"
|
||||
dependencies = [
|
||||
- "cc",
|
||||
"pkg-config",
|
||||
"vcpkg",
|
||||
]
|
||||
diff -up rustc-beta-src/src/tools/cargo/Cargo.toml.orig rustc-beta-src/src/tools/cargo/Cargo.toml
|
||||
--- rustc-beta-src/src/tools/cargo/Cargo.toml.orig 2025-06-13 01:10:18.000000000 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2025-06-13 15:39:34.583102112 -0700
|
||||
@@ -80,7 +80,7 @@ proptest = "1.6.0"
|
||||
pulldown-cmark = { version = "0.13.0", default-features = false, features = ["html"] }
|
||||
rand = "0.9.0"
|
||||
regex = "1.11.1"
|
||||
-rusqlite = { version = "0.34.0", features = ["bundled"] }
|
||||
+rusqlite = { version = "0.34.0", features = [] }
|
||||
rustc-hash = "2.1.1"
|
||||
rustc-stable-hash = "0.1.2"
|
||||
rustfix = { version = "0.9.0", path = "crates/rustfix" }
|
||||
609
SPECS/rust.spec
609
SPECS/rust.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user