Compare commits
4 Commits
51d9507405
...
f913df4c16
Author | SHA1 | Date |
---|---|---|
Josh Stone | f913df4c16 | |
Josh Stone | a7d6aa8cee | |
Josh Stone | 6f4fb6e8f2 | |
Josh Stone | 49b821d733 |
|
@ -15,3 +15,6 @@ SOURCES/wasi-libc-wasi-sdk-17.tar.gz
|
|||
/rustc-1.72.1-src.tar.xz
|
||||
/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
/rustc-1.73.0-src.tar.xz
|
||||
/rustc-1.74.0-src.tar.xz
|
||||
/rustc-1.74.1-src.tar.xz
|
||||
/rustc-1.75.0-src.tar.xz
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
218b11187344e4fbfd7f9c7787c3d7338cf8fe70 rustc-1.73.0-src.tar.xz
|
||||
9ad7bb54dc9572c103b855cdcc823addbb34d15d rustc-1.75.0-src.tar.xz
|
||||
55eaa32c99cc8ec970f2db2d340a605724589f9b wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
|
|
|
@ -1,33 +1,33 @@
|
|||
From 87caaab3681b95fa633aac48b9794364e18c467d Mon Sep 17 00:00:00 2001
|
||||
From 184d61d2c12aa2db01de9a14ccb2be0cfae5039b 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
|
||||
|
||||
---
|
||||
compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs | 2 +-
|
||||
.../src/spec/targets/powerpc64le_unknown_linux_gnu.rs | 2 +-
|
||||
.../rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs | 2 +-
|
||||
.../rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
index fd896e086b54..08d0c43d20b4 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
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
|
||||
--- 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 {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
let mut base = base::linux_gnu::opts();
|
||||
- base.cpu = "ppc64le".into();
|
||||
+ base.cpu = option_env!("RUSTC_TARGET_CPU_PPC64LE").unwrap_or("ppc64le").into();
|
||||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
|
||||
base.max_atomic_width = Some(64);
|
||||
base.stack_probes = StackProbeType::Inline;
|
||||
diff --git a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
index f2c722b9a89d..17a14d10b27e 100644
|
||||
--- a/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/s390x_unknown_linux_gnu.rs
|
||||
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
|
||||
--- 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 {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
let mut base = base::linux_gnu::opts();
|
||||
base.endian = Endian::Big;
|
||||
// z10 is the oldest CPU supported by LLVM
|
||||
- base.cpu = "z10".into();
|
||||
|
@ -35,14 +35,14 @@ index f2c722b9a89d..17a14d10b27e 100644
|
|||
// 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.
|
||||
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
index 2f970f87cc64..7ee62cd62a5c 100644
|
||||
--- a/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/x86_64_unknown_linux_gnu.rs
|
||||
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
|
||||
--- 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 {
|
||||
let mut base = super::linux_gnu_base::opts();
|
||||
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();
|
||||
base.plt_by_default = false;
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
From 35187c7e6474d346eea3113c4ae34d26d6b18756 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Tue, 22 Aug 2023 10:42:12 -0700
|
||||
Subject: [PATCH] Skip ExpandYamlAnchors when the config is missing
|
||||
|
||||
The dist-src tarball does not include `.github/` at all, so we can't
|
||||
check whether it needs to be regenerated.
|
||||
---
|
||||
src/bootstrap/test.rs | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
|
||||
index db3b7ffbea4e..d1018978f78c 100644
|
||||
--- a/src/bootstrap/test.rs
|
||||
+++ b/src/bootstrap/test.rs
|
||||
@@ -1174,6 +1174,11 @@ impl Step for ExpandYamlAnchors {
|
||||
/// appropriate configuration for all our CI providers. This step ensures the tool was called
|
||||
/// by the user before committing CI changes.
|
||||
fn run(self, builder: &Builder<'_>) {
|
||||
+ // Note: `.github/` is not included in dist-src tarballs
|
||||
+ if !builder.src.join(".github/workflows/ci.yml").exists() {
|
||||
+ builder.info("Skipping YAML anchors check: GitHub Actions config not found");
|
||||
+ return;
|
||||
+ }
|
||||
builder.info("Ensuring the YAML anchors in the GitHub Actions config were expanded");
|
||||
builder.run_delaying_failure(
|
||||
&mut builder.tool_cmd(Tool::ExpandYamlAnchors).arg("check").arg(&builder.src),
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -1,8 +1,19 @@
|
|||
diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs
|
||||
index 341763aadbaf..ee6358e72955 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm_base.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm_base.rs
|
||||
@@ -89,8 +89,7 @@ macro_rules! args {
|
||||
From 61b5cc96337da2121221dd1bcdb63fd36551d065 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Wed, 1 Nov 2023 15:21:15 -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(-)
|
||||
|
||||
diff --git a/compiler/rustc_target/src/spec/base/wasm.rs b/compiler/rustc_target/src/spec/base/wasm.rs
|
||||
index 87ade9e58cf4..2ddff95febab 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 {
|
||||
// arguments just yet
|
||||
limit_rdylib_exports: false,
|
||||
|
||||
|
@ -12,10 +23,10 @@ index 341763aadbaf..ee6358e72955 100644
|
|||
linker_flavor: LinkerFlavor::WasmLld(Cc::No),
|
||||
|
||||
pre_link_args,
|
||||
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs
|
||||
index fe3b24f2d4af..1f1731d202ca 100644
|
||||
--- a/compiler/rustc_target/src/spec/x86_64_unknown_none.rs
|
||||
+++ b/compiler/rustc_target/src/spec/x86_64_unknown_none.rs
|
||||
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
|
||||
--- 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 {
|
||||
static_position_independent_executables: true,
|
||||
relro_level: RelroLevel::Full,
|
||||
|
@ -25,15 +36,18 @@ index fe3b24f2d4af..1f1731d202ca 100644
|
|||
features:
|
||||
"-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-3dnow,-3dnowa,-avx,-avx2,+soft-float"
|
||||
.into(),
|
||||
diff --git a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
|
||||
index 67664a74710a..53153cd120a3 100644
|
||||
--- a/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/x86_64_unknown_uefi.rs
|
||||
@@ -12,6 +12,7 @@ pub fn target() -> Target {
|
||||
base.cpu = "x86-64".into();
|
||||
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
|
||||
--- 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 {
|
||||
base.plt_by_default = false;
|
||||
base.max_atomic_width = Some(64);
|
||||
base.entry_abi = Conv::X86_64Win64;
|
||||
+ base.linker = Some("lld".into());
|
||||
|
||||
// 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
|
||||
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
From 19c37083cdae94105f6429350dd0b6617e3c2d56 Mon Sep 17 00:00:00 2001
|
||||
From df0d6f1d8b46db82d7599ca8eff6e8f844cf52f2 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 28 Sep 2023 18:14:28 -0700
|
||||
Subject: [PATCH 1/2] bootstrap: allow disabling target self-contained
|
||||
|
||||
---
|
||||
config.example.toml | 5 +++++
|
||||
src/bootstrap/compile.rs | 4 ++++
|
||||
src/bootstrap/config.rs | 8 ++++++++
|
||||
src/bootstrap/lib.rs | 5 +++++
|
||||
config.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 0c65b25fe138..6a0f1c01c328 100644
|
||||
index e5df28a49af6..2fcd8b8cb057 100644
|
||||
--- a/config.example.toml
|
||||
+++ b/config.example.toml
|
||||
@@ -789,6 +789,11 @@ changelog-seen = 2
|
||||
@@ -807,6 +807,11 @@ change-id = 116881
|
||||
# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.
|
||||
#no-std = <platform-specific> (bool)
|
||||
|
||||
|
@ -26,11 +26,11 @@ index 0c65b25fe138..6a0f1c01c328 100644
|
|||
# =============================================================================
|
||||
# Distribution options
|
||||
#
|
||||
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
|
||||
index 14c3ef79a78f..7adbf091acbb 100644
|
||||
--- a/src/bootstrap/compile.rs
|
||||
+++ b/src/bootstrap/compile.rs
|
||||
@@ -263,6 +263,10 @@ fn copy_self_contained_objects(
|
||||
diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/core/build_steps/compile.rs
|
||||
index 7021a9543582..11555c65ca87 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(
|
||||
compiler: &Compiler,
|
||||
target: TargetSelection,
|
||||
) -> Vec<(PathBuf, DependencyType)> {
|
||||
|
@ -41,11 +41,11 @@ index 14c3ef79a78f..7adbf091acbb 100644
|
|||
let libdir_self_contained = builder.sysroot_libdir(*compiler, target).join("self-contained");
|
||||
t!(fs::create_dir_all(&libdir_self_contained));
|
||||
let mut target_deps = vec![];
|
||||
diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs
|
||||
index fe932fd6bd30..a626badc3e8a 100644
|
||||
--- a/src/bootstrap/config.rs
|
||||
+++ b/src/bootstrap/config.rs
|
||||
@@ -541,6 +541,7 @@ pub struct Target {
|
||||
diff --git a/src/bootstrap/src/core/config/config.rs b/src/bootstrap/src/core/config/config.rs
|
||||
index 0a9175aa3ea5..a2e028b25036 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,
|
||||
|
@ -53,8 +53,8 @@ index fe932fd6bd30..a626badc3e8a 100644
|
|||
}
|
||||
|
||||
impl Target {
|
||||
@@ -553,6 +554,9 @@ pub fn from_triple(triple: &str) -> Self {
|
||||
{
|
||||
@@ -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;
|
||||
}
|
||||
+ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
|
||||
|
@ -63,7 +63,7 @@ index fe932fd6bd30..a626badc3e8a 100644
|
|||
target
|
||||
}
|
||||
}
|
||||
@@ -999,6 +1003,7 @@ struct TomlTarget {
|
||||
@@ -1051,6 +1055,7 @@ struct TomlTarget {
|
||||
wasi_root: Option<String> = "wasi-root",
|
||||
qemu_rootfs: Option<String> = "qemu-rootfs",
|
||||
no_std: Option<bool> = "no-std",
|
||||
|
@ -71,21 +71,21 @@ index fe932fd6bd30..a626badc3e8a 100644
|
|||
}
|
||||
}
|
||||
|
||||
@@ -1524,6 +1529,9 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
||||
@@ -1600,6 +1605,9 @@ fn get_table(option: &str) -> Result<TomlConfig, toml::de::Error> {
|
||||
if let Some(s) = cfg.no_std {
|
||||
target.no_std = s;
|
||||
}
|
||||
+ if let Some(s) = cfg.self_contained {
|
||||
+ target.self_contained = s;
|
||||
+ }
|
||||
target.cc = cfg.cc.map(PathBuf::from).or_else(|| {
|
||||
target.ndk.as_ref().map(|ndk| ndk_compiler(Language::C, &triple, ndk))
|
||||
});
|
||||
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs
|
||||
index 0a7aff62257a..9b7c18a3353f 100644
|
||||
--- a/src/bootstrap/lib.rs
|
||||
+++ b/src/bootstrap/lib.rs
|
||||
@@ -1285,6 +1285,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
|
||||
target.cc = cfg.cc.map(PathBuf::from);
|
||||
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
|
||||
--- a/src/bootstrap/src/lib.rs
|
||||
+++ b/src/bootstrap/src/lib.rs
|
||||
@@ -1335,6 +1335,11 @@ fn no_std(&self, target: TargetSelection) -> Option<bool> {
|
||||
self.config.target_config.get(&target).map(|t| t.no_std)
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
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,33 +0,0 @@
|
|||
From 1c6d867d78475fd8c6274e2b64ebb27735b6cabf Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Sat, 26 Aug 2023 11:50:16 -0700
|
||||
Subject: [PATCH] wasi: round up the size for `aligned_alloc`
|
||||
|
||||
C11 `aligned_alloc` requires that the size be a multiple of the
|
||||
alignment. This is enforced in the wasi-libc emmalloc implementation,
|
||||
which always returns NULL if the size is not a multiple.
|
||||
(The default `MALLOC_IMPL=dlmalloc` does not currently check this.)
|
||||
---
|
||||
library/std/src/sys/unix/alloc.rs | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/library/std/src/sys/unix/alloc.rs b/library/std/src/sys/unix/alloc.rs
|
||||
index 8604b53983d6..af0089978ecb 100644
|
||||
--- a/library/std/src/sys/unix/alloc.rs
|
||||
+++ b/library/std/src/sys/unix/alloc.rs
|
||||
@@ -86,7 +86,11 @@ unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
|
||||
} else if #[cfg(target_os = "wasi")] {
|
||||
#[inline]
|
||||
unsafe fn aligned_malloc(layout: &Layout) -> *mut u8 {
|
||||
- libc::aligned_alloc(layout.align(), layout.size()) as *mut u8
|
||||
+ // C11 aligned_alloc requires that the size be a multiple of the alignment.
|
||||
+ // Layout already checks that the size rounded up doesn't overflow isize::MAX.
|
||||
+ let align = layout.align();
|
||||
+ let size = layout.size().next_multiple_of(align);
|
||||
+ libc::aligned_alloc(align, size) as *mut u8
|
||||
}
|
||||
} else {
|
||||
#[inline]
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -1,19 +1,19 @@
|
|||
From 3016b2b7052d8b01d50c3a3c6591aeb99d918ca3 Mon Sep 17 00:00:00 2001
|
||||
From 79bb610c8fc5d9df7dd4720ae847b8f17e7b1ad4 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 28 Sep 2023 18:18:16 -0700
|
||||
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/wasm32_wasi.rs | 6 +++++-
|
||||
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(-)
|
||||
|
||||
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
index b603a8787460..40d878b64479 100644
|
||||
index dd9d277fb775..3d0f0502f255 100644
|
||||
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
|
||||
@@ -1475,6 +1475,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
|
||||
@@ -1496,6 +1496,12 @@ fn get_object_file_path(sess: &Session, name: &str, self_contained: bool) -> Pat
|
||||
return file_path;
|
||||
}
|
||||
}
|
||||
|
@ -26,7 +26,7 @@ index b603a8787460..40d878b64479 100644
|
|||
for search_path in fs.search_paths() {
|
||||
let file_path = search_path.dir.join(name);
|
||||
if file_path.exists() {
|
||||
@@ -1967,6 +1973,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session, self_contained:
|
||||
@@ -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));
|
||||
}
|
||||
|
@ -37,10 +37,10 @@ index b603a8787460..40d878b64479 100644
|
|||
|
||||
/// Add options making relocation sections in the produced ELF files read-only
|
||||
diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs
|
||||
index 2365dfaf1af8..35f3a686cf67 100644
|
||||
index f04799482c83..25410b37ba24 100644
|
||||
--- a/compiler/rustc_target/src/spec/mod.rs
|
||||
+++ b/compiler/rustc_target/src/spec/mod.rs
|
||||
@@ -1653,6 +1653,7 @@ pub struct TargetOptions {
|
||||
@@ -1874,6 +1874,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 +48,7 @@ index 2365dfaf1af8..35f3a686cf67 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,
|
||||
@@ -2124,6 +2125,7 @@ fn default() -> TargetOptions {
|
||||
@@ -2352,6 +2353,7 @@ fn default() -> TargetOptions {
|
||||
relro_level: RelroLevel::None,
|
||||
pre_link_objects: Default::default(),
|
||||
post_link_objects: Default::default(),
|
||||
|
@ -56,11 +56,11 @@ index 2365dfaf1af8..35f3a686cf67 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/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
index a0476d542e64..ad7160bf5fcd 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
@@ -85,7 +85,11 @@ pub fn target() -> Target {
|
||||
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();
|
||||
|
||||
// FIXME: Figure out cases in which WASM needs to link with a native toolchain.
|
||||
|
|
|
@ -5,17 +5,55 @@
|
|||
# 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 %{_bindir}/env CARGO_HOME=.cargo %{_bindir}/cargo
|
||||
%__rustc %{_bindir}/rustc
|
||||
%__rustdoc %{_bindir}/rustdoc
|
||||
%__cargo /usr/bin/env CARGO_HOME=.cargo RUSTFLAGS='%{build_rustflags}' /usr/bin/cargo
|
||||
%__rustc /usr/bin/rustc
|
||||
%__rustdoc /usr/bin/rustdoc
|
||||
|
||||
# Enable optimization, debuginfo, and link hardening.
|
||||
%__global_rustflags -Copt-level=3 -Cdebuginfo=2 -Clink-arg=-Wl,-z,relro,-z,now
|
||||
# rustflags_opt_level: default optimization level
|
||||
#
|
||||
# It corresponds to the "-Copt-level" rustc command line option.
|
||||
%rustflags_opt_level 3
|
||||
|
||||
%__global_rustflags_toml [%{lua:
|
||||
for arg in string.gmatch(rpm.expand("%{__global_rustflags}"), "%S+") do
|
||||
print('"' .. arg .. '", ')
|
||||
end}]
|
||||
# rustflags_debuginfo: default verbosity of debug information
|
||||
#
|
||||
# It corresponds to the "-Cdebuginfo" rustc command line option.
|
||||
# In some cases, it might be required to override this macro with "1" or even
|
||||
# "0", if memory usage gets too high during builds on some resource-constrained
|
||||
# architectures (most likely on 32-bit architectures), which will however
|
||||
# reduce the quality of the produced debug symbols.
|
||||
%rustflags_debuginfo 2
|
||||
|
||||
# rustflags_codegen_units: default number of parallel code generation units
|
||||
#
|
||||
# The default value of "1" results in generation of better code, but comes at
|
||||
# the cost of longer build times.
|
||||
%rustflags_codegen_units 1
|
||||
|
||||
# build_rustflags: default compiler flags for rustc (RUSTFLAGS)
|
||||
#
|
||||
# -Copt-level: set optimization level (default: highest optimization level)
|
||||
# -Cdebuginfo: set debuginfo verbosity (default: full debug information)
|
||||
# -Ccodegen-units: set number of parallel code generation units (default: 1)
|
||||
# -Cforce-frame-pointers: force inclusion of frame pointers (default: enabled
|
||||
# on x86_64 and aarch64 on Fedora 37+)
|
||||
#
|
||||
# Additionally, some linker flags are set which correspond to the default
|
||||
# Fedora compiler flags for hardening and for embedding package versions into
|
||||
# compiled binaries.
|
||||
#
|
||||
# ref. https://doc.rust-lang.org/rustc/codegen-options/index.html
|
||||
%build_rustflags %{shrink:
|
||||
-Copt-level=%rustflags_opt_level
|
||||
-Cdebuginfo=%rustflags_debuginfo
|
||||
-Ccodegen-units=%rustflags_codegen_units
|
||||
%{expr:0%{?_include_frame_pointers} && ("%{_arch}" != "ppc64le" && "%{_arch}" != "s390x" && "%{_arch}" != "i386") ? "-Cforce-frame-pointers=yes" : ""}
|
||||
%[0%{?_package_note_status} ? "-Clink-arg=%_package_note_flags" : ""]
|
||||
}
|
||||
|
||||
# __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 \
|
||||
|
@ -23,7 +61,11 @@ cat > .cargo/config << EOF \
|
|||
[build]\
|
||||
rustc = "%{__rustc}"\
|
||||
rustdoc = "%{__rustdoc}"\
|
||||
rustflags = %{__global_rustflags_toml}\
|
||||
\
|
||||
[env]\
|
||||
CFLAGS = "%{build_cflags}"\
|
||||
CXXFLAGS = "%{build_cxxflags}"\
|
||||
LDFLAGS = "%{build_ldflags}"\
|
||||
\
|
||||
[install]\
|
||||
root = "%{buildroot}%{_prefix}"\
|
||||
|
@ -44,8 +86,104 @@ EOF\
|
|||
%endif\
|
||||
)
|
||||
|
||||
%cargo_build %__cargo build --release %{?_smp_mflags}
|
||||
# __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}
|
||||
}
|
||||
|
||||
%cargo_test %__cargo test --release %{?_smp_mflags} --no-fail-fast
|
||||
# NB: cargo_build/test/install do not use the -n/-a/-f argument parsing like
|
||||
# Fedora's rust-packaging, because that change would break anyone that's
|
||||
# already passing arguments directly to cargo after the macro. Instead, one can
|
||||
# explicitly use --no-default-features, --all-features, or --features XYZ.
|
||||
|
||||
%cargo_install %__cargo install --no-track --path .
|
||||
# cargo_build: builds the crate with cargo
|
||||
%cargo_build \
|
||||
%{shrink:\
|
||||
%{__cargo} build \
|
||||
%{__cargo_common_opts} \
|
||||
--release \
|
||||
}
|
||||
|
||||
# cargo_test: runs the test suite with cargo
|
||||
#
|
||||
# To pass command-line arguments to the cargo test runners directly (for
|
||||
# example, to skip certain tests during package builds), the
|
||||
# "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_install: install files into the buildroot
|
||||
#
|
||||
# For "binary" crates, this macro installs all "bin" build targets to _bindir
|
||||
# inside the buildroot. The "--no-track" option prevents the creation of the
|
||||
# "$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 \
|
||||
%{shrink: \
|
||||
%{__cargo} install \
|
||||
%{__cargo_common_opts} \
|
||||
--no-track \
|
||||
--path . \
|
||||
} \
|
||||
|
||||
# cargo_license: print license information for all crate dependencies
|
||||
#
|
||||
# The "no-build,no-dev,no-proc-macro" argument results in only crates which are
|
||||
# linked into the final binary to be considered.
|
||||
#
|
||||
# Additionally, deprecated SPDX syntax ("/" instead of "OR") is normalized
|
||||
# before sorting the results to ensure reproducible output of this macro.
|
||||
#
|
||||
# This macro must be called with the same feature flags as other cargo macros,
|
||||
# in particular, "cargo_build", otherwise its output will be incomplete.
|
||||
#
|
||||
# The "cargo tree" command called by this macro will fail if there are missing
|
||||
# (optional) dependencies.
|
||||
%cargo_license(naf:)\
|
||||
%{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
|
||||
}
|
||||
|
||||
# cargo_license_summary: print license summary for all crate dependencies
|
||||
#
|
||||
# This macro works in the same way as cargo_license, except that it only prints
|
||||
# a list of licenses, and not the complete license information for every crate
|
||||
# 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:\
|
||||
%{__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 \
|
||||
}
|
||||
|
|
185
rust.spec
185
rust.spec
|
@ -1,16 +1,22 @@
|
|||
Name: rust
|
||||
Version: 1.75.0
|
||||
Release: 1%{?dist}
|
||||
Summary: The Rust Programming Language
|
||||
License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
|
||||
# ^ written as: (rust itself) and (bundled libraries)
|
||||
URL: https://www.rust-lang.org
|
||||
|
||||
# Only x86_64, i686, and aarch64 are Tier 1 platforms at this time.
|
||||
# https://doc.rust-lang.org/nightly/rustc/platform-support.html
|
||||
%global rust_arches x86_64 i686 aarch64 ppc64le s390x
|
||||
|
||||
# The channel can be stable, beta, or nightly
|
||||
%{!?channel: %global channel stable}
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
# To bootstrap from scratch, set the channel and date from src/stage0.json
|
||||
# e.g. 1.59.0 wants rustc: 1.58.0-2022-01-13
|
||||
# or nightly wants some beta-YYYY-MM-DD
|
||||
%global bootstrap_version 1.72.0
|
||||
%global bootstrap_channel 1.72.0
|
||||
%global bootstrap_date 2023-08-24
|
||||
%global bootstrap_version 1.74.0
|
||||
%global bootstrap_channel 1.74.0
|
||||
%global bootstrap_date 2023-11-16
|
||||
|
||||
# Only the specified arches will use bootstrap binaries.
|
||||
# NOTE: Those binaries used to be uploaded with every new release, but that was
|
||||
|
@ -61,22 +67,20 @@
|
|||
# We can also choose to just use Rust's bundled LLVM, in case the system LLVM
|
||||
# is insufficient. Rust currently requires LLVM 15.0+.
|
||||
%global min_llvm_version 15.0.0
|
||||
%global bundled_llvm_version 17.0.2
|
||||
%global bundled_llvm_version 17.0.5
|
||||
%bcond_with bundled_llvm
|
||||
|
||||
# Requires stable libgit2 1.6, and not the next minor soname change.
|
||||
# Requires stable libgit2 1.7, and not the next minor soname change.
|
||||
# This needs to be consistent with the bindings in vendor/libgit2-sys.
|
||||
%global min_libgit2_version 1.6.4
|
||||
%global next_libgit2_version 1.7.0~
|
||||
%global bundled_libgit2_version 1.6.4
|
||||
%if 0%{?fedora} >= 38
|
||||
%global min_libgit2_version 1.7.1
|
||||
%global next_libgit2_version 1.8.0~
|
||||
%global bundled_libgit2_version 1.7.1
|
||||
%if 0%{?fedora} >= 39
|
||||
%bcond_with bundled_libgit2
|
||||
%else
|
||||
%bcond_without bundled_libgit2
|
||||
%endif
|
||||
|
||||
# needs libssh2_userauth_publickey_frommemory
|
||||
%global min_libssh2_version 1.6.0
|
||||
%if 0%{?rhel}
|
||||
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
|
||||
%bcond_without disabled_libssh2
|
||||
|
@ -84,20 +88,20 @@
|
|||
%bcond_with disabled_libssh2
|
||||
%endif
|
||||
|
||||
Name: rust
|
||||
Version: 1.73.0
|
||||
Release: 1%{?dist}
|
||||
Summary: The Rust Programming Language
|
||||
License: (Apache-2.0 OR MIT) AND (Artistic-2.0 AND BSD-3-Clause AND ISC AND MIT AND MPL-2.0 AND Unicode-DFS-2016)
|
||||
# ^ written as: (rust itself) and (bundled libraries)
|
||||
URL: https://www.rust-lang.org
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
%if "%{channel}" == "stable"
|
||||
%global rustc_package rustc-%{version}-src
|
||||
%if 0%{?__isa_bits} == 32
|
||||
# Disable PGO on 32-bit to reduce build memory
|
||||
%bcond_with rustc_pgo
|
||||
%else
|
||||
%global rustc_package rustc-%{channel}-src
|
||||
%bcond_without rustc_pgo
|
||||
%endif
|
||||
|
||||
# Detect non-stable channels from the version, like 1.74.0~beta.1
|
||||
%{lua: do
|
||||
local version = rpm.expand("%{version}")
|
||||
local version_channel, subs = string.gsub(version, "^.*~(%w+).*$", "%1", 1)
|
||||
rpm.define("channel " .. (subs ~= 0 and version_channel or "stable"))
|
||||
rpm.define("rustc_package rustc-" .. version_channel .. "-src")
|
||||
end}
|
||||
Source0: https://static.rust-lang.org/dist/%{rustc_package}.tar.xz
|
||||
Source1: %{wasi_libc_source}
|
||||
# Sources for bootstrap_arches are inserted by lua below
|
||||
|
@ -118,13 +122,8 @@ Patch3: 0001-Let-environment-variables-override-some-default-CPUs.patch
|
|||
Patch4: 0001-bootstrap-allow-disabling-target-self-contained.patch
|
||||
Patch5: 0002-set-an-external-library-path-for-wasm32-wasi.patch
|
||||
|
||||
# The dist-src tarball doesn't include .github/
|
||||
# https://github.com/rust-lang/rust/pull/115109
|
||||
Patch6: 0001-Skip-ExpandYamlAnchors-when-the-config-is-missing.patch
|
||||
|
||||
# wasi: round up the size for aligned_alloc
|
||||
# https://github.com/rust-lang/rust/pull/115254
|
||||
Patch7: 0001-wasi-round-up-the-size-for-aligned_alloc.patch
|
||||
# https://github.com/rust-lang/rust/pull/117982
|
||||
Patch6: 0001-bootstrap-only-show-PGO-warnings-when-verbose.patch
|
||||
|
||||
### RHEL-specific patches below ###
|
||||
|
||||
|
@ -132,7 +131,7 @@ Patch7: 0001-wasi-round-up-the-size-for-aligned_alloc.patch
|
|||
Source100: macros.rust-toolset
|
||||
|
||||
# Disable cargo->libgit2->libssh2 on RHEL, as it's not approved for FIPS (rhbz1732949)
|
||||
Patch100: rustc-1.73.0-disable-libssh2.patch
|
||||
Patch100: rustc-1.75.0-disable-libssh2.patch
|
||||
|
||||
# Get the Rust triple for any arch.
|
||||
%{lua: function rust_triple(arch)
|
||||
|
@ -209,7 +208,7 @@ BuildRequires: (pkgconfig(libgit2) >= %{min_libgit2_version} with pkgconfig(lib
|
|||
%endif
|
||||
|
||||
%if %{without disabled_libssh2}
|
||||
BuildRequires: pkgconfig(libssh2) >= %{min_libssh2_version}
|
||||
BuildRequires: pkgconfig(libssh2)
|
||||
%endif
|
||||
|
||||
%if 0%{?rhel} == 8
|
||||
|
@ -220,14 +219,11 @@ BuildRequires: python3
|
|||
BuildRequires: python3-rpm-macros
|
||||
|
||||
%if %with bundled_llvm
|
||||
BuildRequires: cmake3 >= 3.13.4
|
||||
BuildRequires: cmake >= 3.20.0
|
||||
BuildRequires: ninja-build
|
||||
Provides: bundled(llvm) = %{bundled_llvm_version}
|
||||
%else
|
||||
BuildRequires: cmake >= 2.8.11
|
||||
%if 0%{?epel} == 7
|
||||
%global llvm llvm14
|
||||
%endif
|
||||
BuildRequires: cmake >= 3.5.1
|
||||
%if %defined llvm
|
||||
%global llvm_root %{_libdir}/%{llvm}
|
||||
%else
|
||||
|
@ -262,20 +258,7 @@ Requires: %{name}-std-static%{?_isa} = %{version}-%{release}
|
|||
# https://github.com/rust-lang/rust/issues/11937
|
||||
Requires: /usr/bin/cc
|
||||
|
||||
%if 0%{?epel} == 7
|
||||
%global devtoolset_name devtoolset-11
|
||||
BuildRequires: %{devtoolset_name}-binutils
|
||||
BuildRequires: %{devtoolset_name}-gcc
|
||||
BuildRequires: %{devtoolset_name}-gcc-c++
|
||||
%global devtoolset_bindir /opt/rh/%{devtoolset_name}/root/usr/bin
|
||||
%global __cc %{devtoolset_bindir}/gcc
|
||||
%global __cxx %{devtoolset_bindir}/g++
|
||||
%global __ar %{devtoolset_bindir}/ar
|
||||
%global __ranlib %{devtoolset_bindir}/ranlib
|
||||
%global __strip %{devtoolset_bindir}/strip
|
||||
%else
|
||||
%global __ranlib %{_bindir}/ranlib
|
||||
%endif
|
||||
|
||||
# ALL Rust libraries are private, because they don't keep an ABI.
|
||||
%global _privatelibs lib(.*-[[:xdigit:]]{16}*|rustc.*)[.]so.*
|
||||
|
@ -585,7 +568,6 @@ rm -rf %{wasi_libc_dir}/dlmalloc/
|
|||
%patch -P5 -p1
|
||||
%endif
|
||||
%patch -P6 -p1
|
||||
%patch -P7 -p1
|
||||
|
||||
%if %with disabled_libssh2
|
||||
%patch -P100 -p1
|
||||
|
@ -602,18 +584,21 @@ rm -rf src/llvm-project/
|
|||
mkdir -p src/llvm-project/libunwind/
|
||||
%endif
|
||||
|
||||
# Remove other unused vendored libraries
|
||||
rm -rf vendor/curl-sys*/curl/
|
||||
rm -rf vendor/*jemalloc-sys*/jemalloc/
|
||||
rm -rf vendor/libffi-sys*/libffi/
|
||||
rm -rf vendor/libmimalloc-sys*/c_src/mimalloc/
|
||||
rm -rf vendor/libssh2-sys*/libssh2/
|
||||
rm -rf vendor/libz-sys*/src/zlib{,-ng}/
|
||||
rm -rf vendor/lzma-sys*/xz-*/
|
||||
rm -rf vendor/openssl-src*/openssl/
|
||||
|
||||
# Remove other unused vendored libraries. This leaves the directory in place,
|
||||
# because some build scripts watch them, e.g. "cargo:rerun-if-changed=curl".
|
||||
%define clear_dir() find ./%1 -mindepth 1 -delete
|
||||
%clear_dir vendor/curl-sys*/curl/
|
||||
%clear_dir vendor/*jemalloc-sys*/jemalloc/
|
||||
%clear_dir vendor/libffi-sys*/libffi/
|
||||
%clear_dir vendor/libmimalloc-sys*/c_src/mimalloc/
|
||||
%clear_dir vendor/libssh2-sys*/libssh2/
|
||||
%clear_dir vendor/libz-sys*/src/zlib{,-ng}/
|
||||
%clear_dir vendor/lzma-sys*/xz-*/
|
||||
%clear_dir vendor/openssl-src*/openssl/
|
||||
|
||||
%if %without bundled_libgit2
|
||||
rm -rf vendor/libgit2-sys*/libgit2/
|
||||
%clear_dir vendor/libgit2-sys*/libgit2/
|
||||
%endif
|
||||
|
||||
%if %with disabled_libssh2
|
||||
|
@ -621,13 +606,7 @@ rm -rf vendor/libssh2-sys*/
|
|||
%endif
|
||||
|
||||
# This only affects the transient rust-installer, but let it use our dynamic xz-libs
|
||||
sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/tool.rs
|
||||
|
||||
%if %{with bundled_llvm} && 0%{?epel} == 7
|
||||
mkdir -p cmake-bin
|
||||
ln -s /usr/bin/cmake3 cmake-bin/cmake
|
||||
%global cmake_path $PWD/cmake-bin
|
||||
%endif
|
||||
sed -i.lzma -e '/LZMA_API_STATIC/d' src/bootstrap/src/core/build_steps/tool.rs
|
||||
|
||||
%if %{without bundled_llvm} && %{with llvm_static}
|
||||
# Static linking to distro LLVM needs to add -lffi
|
||||
|
@ -667,9 +646,6 @@ end}
|
|||
|
||||
# Set up shared environment variables for build/install/check
|
||||
%global rust_env %{?rustflags:RUSTFLAGS="%{rustflags}"} %{rustc_target_cpus}
|
||||
%if %defined cmake_path
|
||||
%global rust_env %{?rust_env} PATH="%{cmake_path}:$PATH"
|
||||
%endif
|
||||
%if %without disabled_libssh2
|
||||
# convince libssh2-sys to use the distro libssh2
|
||||
%global rust_env %{?rust_env} LIBSSH2_SYS_USE_PKG_CONFIG=1
|
||||
|
@ -680,11 +656,13 @@ end}
|
|||
%{export_rust_env}
|
||||
|
||||
%ifarch %{arm} %{ix86}
|
||||
# full debuginfo is exhausting memory; just do libstd for now
|
||||
# full debuginfo and compiler opts are exhausting memory; just do libstd for now
|
||||
# https://github.com/rust-lang/rust/issues/45854
|
||||
%define enable_debuginfo --debuginfo-level=0 --debuginfo-level-std=2
|
||||
%define enable_rust_opts --set rust.codegen-units-std=1
|
||||
%else
|
||||
%define enable_debuginfo --debuginfo-level=2
|
||||
%define enable_rust_opts --set rust.codegen-units=1 --set rust.lto=thin
|
||||
%endif
|
||||
|
||||
# Some builders have relatively little memory for their CPU count.
|
||||
|
@ -727,7 +705,7 @@ fi
|
|||
%define profiler %{clang_resource_dir}/lib/%{_arch}-redhat-linux-gnu/libclang_rt.profile.a
|
||||
%else
|
||||
# The exact profiler path is version dependent..
|
||||
%define profiler %(echo %{_libdir}/clang/*/lib/libclang_rt.profile-%{_arch}.a)
|
||||
%define profiler %(echo %{_libdir}/clang/??/lib/libclang_rt.profile-*.a)
|
||||
%endif
|
||||
test -r "%{profiler}"
|
||||
|
||||
|
@ -751,7 +729,7 @@ test -r "%{profiler}"
|
|||
--disable-llvm-static-stdcpp \
|
||||
--disable-rpath \
|
||||
%{enable_debuginfo} \
|
||||
--set rust.codegen-units-std=1 \
|
||||
%{enable_rust_opts} \
|
||||
--set build.build-stage=2 \
|
||||
--set build.doc-stage=2 \
|
||||
--set build.install-stage=2 \
|
||||
|
@ -764,11 +742,32 @@ test -r "%{profiler}"
|
|||
--release-channel=%{channel} \
|
||||
--release-description="%{?fedora:Fedora }%{?rhel:Red Hat }%{version}-%{release}"
|
||||
|
||||
%{__python3} ./x.py build -j "$ncpus"
|
||||
%{__python3} ./x.py doc
|
||||
%global __x %{__python3} ./x.py
|
||||
%global __xk %{__x} --keep-stage=0 --keep-stage=1
|
||||
|
||||
%if %with rustc_pgo
|
||||
# Build the compiler with profile instrumentation
|
||||
PROFRAW="$PWD/build/profiles"
|
||||
PROFDATA="$PWD/build/rustc.profdata"
|
||||
mkdir -p "$PROFRAW"
|
||||
%{__x} build -j "$ncpus" sysroot --rust-profile-generate="$PROFRAW"
|
||||
# Build cargo as a workload to generate compiler profiles
|
||||
env LLVM_PROFILE_FILE="$PROFRAW/default_%%m_%%p.profraw" %{__xk} build cargo
|
||||
llvm-profdata merge -o "$PROFDATA" "$PROFRAW"
|
||||
rm -r "$PROFRAW" build/%{rust_triple}/stage2*/
|
||||
# Rebuild the compiler using the profile data
|
||||
%{__x} build -j "$ncpus" sysroot --rust-profile-use="$PROFDATA"
|
||||
%else
|
||||
# Build the compiler without PGO
|
||||
%{__x} build -j "$ncpus" sysroot
|
||||
%endif
|
||||
|
||||
# Build everything else normally
|
||||
%{__xk} build
|
||||
%{__xk} doc
|
||||
|
||||
for triple in %{?all_targets} ; do
|
||||
%{__python3} ./x.py build --target=$triple std
|
||||
%{__xk} build --target=$triple std
|
||||
done
|
||||
|
||||
%install
|
||||
|
@ -777,10 +776,10 @@ done
|
|||
%endif
|
||||
%{export_rust_env}
|
||||
|
||||
DESTDIR=%{buildroot} %{__python3} ./x.py install
|
||||
DESTDIR=%{buildroot} %{__xk} install
|
||||
|
||||
for triple in %{?all_targets} ; do
|
||||
DESTDIR=%{buildroot} %{__python3} ./x.py install --target=$triple std
|
||||
DESTDIR=%{buildroot} %{__xk} install --target=$triple std
|
||||
done
|
||||
|
||||
# The rls stub doesn't have an install target, but we can just copy it.
|
||||
|
@ -866,11 +865,12 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
|
|||
%{export_rust_env}
|
||||
|
||||
# Sanity-check the installed binaries, debuginfo-stripped and all.
|
||||
%{buildroot}%{_bindir}/cargo new build/hello-world
|
||||
TMP_HELLO=$(mktemp -d)
|
||||
(
|
||||
cd build/hello-world
|
||||
cd "$TMP_HELLO"
|
||||
export RUSTC=%{buildroot}%{_bindir}/rustc \
|
||||
LD_LIBRARY_PATH="%{buildroot}%{_libdir}:$LD_LIBRARY_PATH"
|
||||
%{buildroot}%{_bindir}/cargo init --name hello-world
|
||||
%{buildroot}%{_bindir}/cargo run --verbose
|
||||
|
||||
# Sanity-check that code-coverage builds and runs
|
||||
|
@ -882,23 +882,24 @@ rm -f %{buildroot}%{rustlibdir}/%{rust_triple}/bin/rust-ll*
|
|||
%{buildroot}%{_bindir}/cargo build --verbose --target=$triple
|
||||
done
|
||||
)
|
||||
rm -rf "$TMP_HELLO"
|
||||
|
||||
# The results are not stable on koji, so mask errors and just log it.
|
||||
# Some of the larger test artifacts are manually cleaned to save space.
|
||||
|
||||
# Bootstrap is excluded because it's not something we ship, and a lot of its
|
||||
# tests are geared toward the upstream CI environment.
|
||||
timeout -v 90m %{__python3} ./x.py test --no-fail-fast --skip src/bootstrap || :
|
||||
timeout -v 90m %{__xk} test --no-fail-fast --skip src/bootstrap || :
|
||||
rm -rf "./build/%{rust_triple}/test/"
|
||||
|
||||
timeout -v 30m %{__python3} ./x.py test --no-fail-fast cargo || :
|
||||
timeout -v 30m %{__xk} test --no-fail-fast cargo || :
|
||||
rm -rf "./build/%{rust_triple}/stage2-tools/%{rust_triple}/cit/"
|
||||
|
||||
timeout -v 30m %{__python3} ./x.py test --no-fail-fast clippy || :
|
||||
timeout -v 30m %{__xk} test --no-fail-fast clippy || :
|
||||
|
||||
timeout -v 30m %{__python3} ./x.py test --no-fail-fast rust-analyzer || :
|
||||
timeout -v 30m %{__xk} test --no-fail-fast rust-analyzer || :
|
||||
|
||||
timeout -v 30m %{__python3} ./x.py test --no-fail-fast rustfmt || :
|
||||
timeout -v 30m %{__xk} test --no-fail-fast rustfmt || :
|
||||
|
||||
|
||||
%ldconfig_scriptlets
|
||||
|
@ -1039,6 +1040,12 @@ timeout -v 30m %{__python3} ./x.py test --no-fail-fast rustfmt || :
|
|||
|
||||
|
||||
%changelog
|
||||
* Fri Jan 05 2024 Josh Stone <jistone@redhat.com> - 1.75.0-1
|
||||
- Update to 1.75.0.
|
||||
|
||||
* Wed Jan 03 2024 Josh Stone <jistone@redhat.com> - 1.74.1-1
|
||||
- Update to 1.74.1.
|
||||
|
||||
* Tue Oct 17 2023 Josh Stone <jistone@redhat.com> - 1.73.0-1
|
||||
- Update to 1.73.0.
|
||||
- Use emmalloc instead of CC0 dlmalloc when bundling wasi-libc
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
--- rustc-beta-src/src/tools/cargo/Cargo.lock.orig 2023-09-01 10:51:15.000000000 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.lock 2023-09-05 16:59:08.837345133 -0700
|
||||
@@ -1973,7 +1973,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -2006,20 +2005,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-09-05 16:59:08.837345133 -0700
|
||||
+++ rustc-beta-src/src/tools/cargo/Cargo.toml 2023-09-05 17:00:00.828461993 -0700
|
||||
@@ -37,7 +37,7 @@
|
||||
filetime = "0.2.21"
|
||||
flate2 = { version = "1.0.26", default-features = false, features = ["zlib"] }
|
||||
fwdansi = "1.1.0"
|
||||
-git2 = "0.17.2"
|
||||
+git2 = { version = "0.17.2", default-features = false, features = ["https"] }
|
||||
git2-curl = "0.18.0"
|
||||
gix = { version = "0.45.1", default-features = false, features = ["blocking-http-transport-curl", "progress-tree"] }
|
||||
gix-features-for-configuration-only = { version = "0.30.0", package = "gix-features", features = [ "parallel" ] }
|
|
@ -0,0 +1,42 @@
|
|||
--- ./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" ] }
|
2
sources
2
sources
|
@ -1,2 +1,2 @@
|
|||
SHA512 (rustc-1.73.0-src.tar.xz) = 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c
|
||||
SHA512 (rustc-1.75.0-src.tar.xz) = 7b0f25d91b1b5c317980fc88e059200bd43b56a70b445fbc72fb9b96e09775bfd3a98e9bd9d662af80f0ce3aef527c777ee82777e96ca876f47a972d63da8606
|
||||
SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066
|
||||
|
|
Loading…
Reference in New Issue