Compare commits

...

47 Commits

Author SHA1 Message Date
David Abdurachmanov 574eef1ee9
Lower memory usage for riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-08 14:19:52 +02:00
David Abdurachmanov 0612936528
Merge remote-tracking branch 'up/main' into main-riscv64
Signed-off-by: David Abdurachmanov <davidlt@rivosinc.com>
2023-11-08 14:15:53 +02:00
Josh Stone 9746593522 Use thin-LTO and PGO for rustc itself. 2023-10-26 09:01:56 -07:00
Josh Stone 4740f18b01 Loosen the search for older libclang_rt.profile 2023-10-05 15:45:24 -07:00
Josh Stone 0b6ffb1d4a Update to 1.73.0.
Drop el7 conditionals from the spec.
2023-10-05 09:24:56 -07:00
Daniel P. Berrangé afbd2cf0c4 ensure rustfmt pulls in exact matching rust evr
/usr/bin/rustfmt is linking to an internal rust library and this
results in load errors if rustfmt and rust are at different evrs:

$ rustfmt
rustfmt: error while loading shared libraries: librustc_driver-69c69b1255476b63.so: cannot open shared object file: No such file or directory
$ rpm -q rust rustfmt
rust-1.72.0-1.fc38.x86_64
rustfmt-1.72.1-1.fc38.x86_64

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-10-04 10:50:58 +01:00
Josh Stone fbe7f8404b Switch to unbundled wasi-libc on Fedora
Also, use emmalloc instead of CC0 dlmalloc when bundling wasi-libc.
2023-09-29 14:56:44 -07:00
Josh Stone 938db5293e Fix the profiler runtime with compiler-rt-17 2023-09-27 12:05:39 -07:00
Josh Stone 68e85e4428 Simplify the target definitions 2023-09-27 12:05:39 -07:00
Josh Stone b2411fce72 Drop noarch from embedded x86_64 targets and use lld 2023-09-25 13:45:57 -07:00
Daniel P. Berrangé 9f66968c10 add 'x86_64-unknown-uefi' build target
This target will facilitate the use of Rust in the UEFI environment

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-25 11:36:55 -07:00
Daniel P. Berrangé 58662257c8 add 'x86_64-unknown-none' build target
The coconut-svsm project which provides a low level firmware for AMD
SEV-SNP virtual machines uses 'x86_64-unknown-none' as its build
target and has recently removed the requirement to use rust nightly[1].

Thus adding 'x86_64-unknown-none' as a build target will enable us to
build coconut-svsm in Fedora using the standard Rust toolchain packages.

[1] https://github.com/coconut-svsm/svsm/pull/81
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
2023-09-25 11:36:00 -07:00
Yaakov Selkowitz da52e5d316 Fix ELN build
ELN (RHEL 10) tracks rawhide and currently also has llvm-17.
2023-09-25 11:35:03 -07:00
Josh Stone b1db162b38 Update to 1.72.1.
Migrated to SPDX license
2023-09-19 10:09:40 -07:00
Josh Stone 0764fad18b Update to 1.72.0. 2023-08-24 11:15:39 -07:00
Josh Stone 1265039e13 Disable profiler_builtins for EPEL7
We don't have compiler-rt available there.
2023-08-07 16:39:57 -07:00
Josh Stone cd2d5f3610 Update to 1.71.1.
Security fix for CVE-2023-38497
2023-08-07 14:57:21 -07:00
Josh Stone 8cfe070190 Relax the suspicious_double_ref_op lint
Enable the profiler runtime for native hosts
2023-07-25 17:53:22 -07:00
Fedora Release Engineering 2f56a4c918 Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-07-21 18:41:30 +00:00
Josh Stone 386b9914c9 Update to 1.71.0. 2023-07-17 09:24:25 -07:00
Josh Stone 356401c7f1 Override default target CPUs to match distro settings 2023-06-23 15:31:28 -07:00
Josh Stone 6fff218b19 Update to 1.70.0. 2023-06-01 12:46:43 -07:00
Josh Stone ff66501ce9 Apply set_build_flags on rhel 2023-05-24 08:58:17 -07:00
Jesus Checa Hidalgo 8745dbe4c6 Add rpminspect.yaml config file
Added suppresion for reduced debuginfo in i386 builds.
2023-05-08 11:47:54 +00:00
Josh Stone 777115da9e Fix debuginfo with LLVM 16 2023-05-05 13:28:08 -07:00
Josh Stone 41fd9d7898 Build with LLVM 15 on Fedora 38+ 2023-05-01 10:07:31 -07:00
Josh Stone 77613da92c Update to 1.69.0.
Obsolete rust-analysis.
2023-04-20 09:47:54 -07:00
Josh Stone 7ac7a42b5e Update to 1.68.2. 2023-03-28 10:11:01 -07:00
Josh Stone b4bb093ae0 Update to 1.68.1. 2023-03-23 08:42:27 -07:00
Josh Stone a07799699f Update to 1.68.0. 2023-03-09 08:52:34 -08:00
David Michael b85b429e00 Add a virtual Provides to rust-std-static with the target triple
This supports depending on a variable target using something like
the following since the other target stdlib subpackages are named
by this convention.

    BuildRequires:  rust-std-static-%{cargo_target}
2023-03-07 10:34:35 -08:00
Orion Poplawski 7f5b9608ec Make rust-toolset noarch 2023-03-06 15:11:28 -08:00
Orion Poplawski 375b75425b Ship rust-toolset for EPEL7 2023-03-06 15:11:28 -08:00
Josh Stone f50b7f0c26 fedpkg new-sources 2023-02-09 16:56:40 -08:00
Josh Stone 752fe3bcd2 Update to 1.67.1. 2023-02-09 16:52:15 -08:00
Josh Stone d8cb2d0d2e Unbundle libgit2 on Fedora 38. 2023-02-03 14:44:01 -08:00
Adam Williamson de19464425 Drop private build tag inadvertently left in release 2023-01-27 15:02:29 -08:00
Adam Williamson 23df2b257f Backport a couple of fixes from upstream
One fix to a problem that broke mesa build, and one fix to a
problem that broke rust bootstrap.
2023-01-27 15:00:45 -08:00
Josh Stone d90cdf5795 Update to 1.67.0. 2023-01-26 12:09:44 -08:00
Fedora Release Engineering 4ee64c64a1 Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2023-01-20 21:24:34 +00:00
Jesus Checa Hidalgo dbc2fd6f22 rpmbuild-librsvg2: Get deps from srpm instead spec file to generate the dynamic dependencies 2023-01-11 19:29:09 +01:00
Josh Stone 256f31f182 fedpkg new-sources 2023-01-10 18:30:35 -08:00
Josh Stone 5a745388ed Update to 1.66.1.
Security fix for CVE-2022-46176
2023-01-10 18:05:07 -08:00
Josh Stone 1f0d4ff0a2 Update CI plan to tmt 2023-01-04 10:51:03 -08:00
Josh Stone 5379ac25ac Update to 1.66.0. 2022-12-15 09:12:22 -08:00
Josh Stone f5bf4afaf1 Update to 1.65.0.
rust-analyzer now obsoletes rls.
2022-11-03 11:11:45 -07:00
Josh Stone fbf19ab00e Update to 1.64.0.
Add rust-analyzer.
2022-09-22 13:06:42 -07:00
19 changed files with 891 additions and 557 deletions

23
.gitignore vendored
View File

@ -404,3 +404,26 @@
/rustc-1.62.0-src.tar.xz
/rustc-1.62.1-src.tar.xz
/rustc-1.63.0-src.tar.xz
/rustc-1.64.0-src.tar.xz
/rustc-1.65.0-src.tar.xz
/wasi-libc-wasi-sdk-16.tar.gz
/rustc-1.66.0-src.tar.xz
/wasi-libc-wasi-sdk-17.tar.gz
/rustc-1.66.1-src.tar.xz
/rustc-1.67.0-src.tar.xz
/rustc-1.67.1-src.tar.xz
/rustc-1.68.0-src.tar.xz
/wasi-libc-wasi-sdk-19.tar.gz
/rustc-1.68.1-src.tar.xz
/rustc-1.68.2-src.tar.xz
/rustc-1.69.0-src.tar.xz
/wasi-libc-1dfe5c302d1c5ab621f7abf04620fae92700fd22.tar.gz
/rustc-1.70.0-src.tar.xz
/wasi-libc-wasi-sdk-20.tar.gz
/rustc-1.71.0-src.tar.xz
/rustc-1.71.1-src.tar.xz
/rustc-1.72.0-src.tar.xz
/wasi-libc-7018e24d8fe248596819d2e884761676f3542a04.tar.gz
/rustc-1.72.1-src.tar.xz
/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
/rustc-1.73.0-src.tar.xz

View File

@ -0,0 +1,53 @@
From 87caaab3681b95fa633aac48b9794364e18c467d 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 +-
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
@@ -2,7 +2,7 @@
pub fn target() -> Target {
let mut base = super::linux_gnu_base::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
@@ -5,7 +5,7 @@ pub fn target() -> Target {
let mut base = super::linux_gnu_base::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.
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
@@ -2,7 +2,7 @@
pub fn target() -> Target {
let mut base = super::linux_gnu_base::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;
base.max_atomic_width = Some(64);
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
--
2.41.0

View File

@ -0,0 +1,30 @@
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

View File

@ -1,26 +0,0 @@
From b521511174b1a08dddfac243604d649b71cc7386 Mon Sep 17 00:00:00 2001
From: Ivan Mironov <mironov.ivan@gmail.com>
Date: Sun, 8 Dec 2019 17:23:08 +0500
Subject: [PATCH] Use lld provided by system for wasm
---
compiler/rustc_target/src/spec/wasm_base.rs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/compiler/rustc_target/src/spec/wasm_base.rs b/compiler/rustc_target/src/spec/wasm_base.rs
index de7b7374af31..eebbe616e9b6 100644
--- a/compiler/rustc_target/src/spec/wasm_base.rs
+++ b/compiler/rustc_target/src/spec/wasm_base.rs
@@ -99,8 +99,7 @@ pub fn options() -> TargetOptions {
// arguments just yet
limit_rdylib_exports: false,
- // we use the LLD shipped with the Rust toolchain by default
- linker: Some("rust-lld".into()),
+ linker: Some("lld".into()),
lld_flavor: LldFlavor::Wasm,
linker_is_gnu: false,
--
2.35.1

View File

@ -0,0 +1,39 @@
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 {
// arguments just yet
limit_rdylib_exports: false,
- // we use the LLD shipped with the Rust toolchain by default
- linker: Some("rust-lld".into()),
+ linker: Some("lld".into()),
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
@@ -17,7 +17,7 @@ pub 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(),
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();
base.plt_by_default = false;
base.max_atomic_width = Some(64);
+ 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

View File

@ -0,0 +1,102 @@
From 19c37083cdae94105f6429350dd0b6617e3c2d56 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 +++++
4 files changed, 22 insertions(+)
diff --git a/config.example.toml b/config.example.toml
index 0c65b25fe138..6a0f1c01c328 100644
--- a/config.example.toml
+++ b/config.example.toml
@@ -789,6 +789,11 @@ changelog-seen = 2
# target triples containing `-none`, `nvptx`, `switch`, or `-uefi`.
#no-std = <platform-specific> (bool)
+# Copy libc and CRT objects into the target lib/self-contained/ directory.
+# Enabled by default on `musl`, `wasi`, and `windows-gnu` targets. Other
+# targets may ignore this setting if they have nothing to be contained.
+#self-contained = <platform-specific> (bool)
+
# =============================================================================
# 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(
compiler: &Compiler,
target: TargetSelection,
) -> Vec<(PathBuf, DependencyType)> {
+ if builder.self_contained(target) != Some(true) {
+ return vec![];
+ }
+
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 {
pub wasi_root: Option<PathBuf>,
pub qemu_rootfs: Option<PathBuf>,
pub no_std: bool,
+ pub self_contained: bool,
}
impl Target {
@@ -553,6 +554,9 @@ pub fn from_triple(triple: &str) -> Self {
{
target.no_std = true;
}
+ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
+ target.self_contained = true;
+ }
target
}
}
@@ -999,6 +1003,7 @@ struct TomlTarget {
wasi_root: Option<String> = "wasi-root",
qemu_rootfs: Option<String> = "qemu-rootfs",
no_std: Option<bool> = "no-std",
+ self_contained: Option<bool> = "self-contained",
}
}
@@ -1524,6 +1529,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> {
self.config.target_config.get(&target).map(|t| t.no_std)
}
+ /// Returns `true` if this is a self-contained `target`, if defined
+ fn self_contained(&self, target: TargetSelection) -> Option<bool> {
+ self.config.target_config.get(&target).map(|t| t.self_contained)
+ }
+
/// Returns `true` if the target will be tested using the `remote-test-client`
/// and `remote-test-server` binaries.
fn remote_tested(&self, target: TargetSelection) -> bool {
--
2.41.0

View File

@ -0,0 +1,33 @@
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

View File

@ -0,0 +1,78 @@
From 3016b2b7052d8b01d50c3a3c6591aeb99d918ca3 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 +++++-
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
--- 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
return file_path;
}
}
+ if let Some(lib_path) = &sess.target.options.external_lib_path {
+ let file_path = Path::new(lib_path.as_ref()).join(name);
+ if file_path.exists() {
+ return file_path;
+ }
+ }
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:
let lib_path = sess.target_filesearch(PathKind::All).get_self_contained_lib_path();
cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
}
+ 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/mod.rs b/compiler/rustc_target/src/spec/mod.rs
index 2365dfaf1af8..35f3a686cf67 100644
--- a/compiler/rustc_target/src/spec/mod.rs
+++ b/compiler/rustc_target/src/spec/mod.rs
@@ -1653,6 +1653,7 @@ pub struct TargetOptions {
/// Objects to link before and after all other object code.
pub pre_link_objects: CrtObjects,
pub post_link_objects: CrtObjects,
+ pub external_lib_path: Option<StaticCow<str>>,
/// 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 {
relro_level: RelroLevel::None,
pre_link_objects: Default::default(),
post_link_objects: Default::default(),
+ external_lib_path: None,
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 {
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.
- 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

View File

@ -1,6 +1,5 @@
summary: CI Gating Plan
discover:
how: fmf
directory: tests
execute:
how: beakerlib
how: tmt

8
rpminspect.yaml Normal file
View File

@ -0,0 +1,8 @@
---
debuginfo:
ignore:
# i686 has limited debuginfo. From rust.spec
# full debuginfo is exhausting memory; just do libstd for now
# https://github.com/rust-lang/rust/issues/45854
- /usr/lib/debug/usr/bin/rustc-*.i386.debug

787
rust.spec

File diff suppressed because it is too large Load Diff

View File

@ -1,44 +0,0 @@
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs
index 638b2a7b5a9f..79d4ecf4cb91 100644
--- a/compiler/rustc_codegen_ssa/src/back/link.rs
+++ b/compiler/rustc_codegen_ssa/src/back/link.rs
@@ -763,7 +763,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
&& cmd.get_args().iter().any(|e| e.to_string_lossy() == "-no-pie")
{
info!("linker output: {:?}", out);
- warn!("Linker does not support -no-pie command line option. Retrying without.");
+ info!("Linker does not support -no-pie command line option. Retrying without.");
for arg in cmd.take_args() {
if arg.to_string_lossy() != "-no-pie" {
cmd.arg(arg);
@@ -782,7 +782,7 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(
&& cmd.get_args().iter().any(|e| e.to_string_lossy() == "-static-pie")
{
info!("linker output: {:?}", out);
- warn!(
+ info!(
"Linker does not support -static-pie command line option. Retrying with -static instead."
);
// Mirror `add_(pre,post)_link_objects` to replace CRT objects.
@@ -1507,15 +1507,14 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
}
fn link_output_kind(sess: &Session, crate_type: CrateType) -> LinkOutputKind {
- let kind = match (crate_type, sess.crt_static(Some(crate_type)), sess.relocation_model()) {
+ // Only use PIE if explicitly specified.
+ let explicit_pic =
+ matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic | RelocModel::Pie));
+ let kind = match (crate_type, sess.crt_static(Some(crate_type)), explicit_pic) {
(CrateType::Executable, _, _) if sess.is_wasi_reactor() => LinkOutputKind::WasiReactorExe,
- (CrateType::Executable, false, RelocModel::Pic | RelocModel::Pie) => {
- LinkOutputKind::DynamicPicExe
- }
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
- (CrateType::Executable, true, RelocModel::Pic | RelocModel::Pie) => {
- LinkOutputKind::StaticPicExe
- }
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
(_, true, _) => LinkOutputKind::StaticDylib,
(_, false, _) => LinkOutputKind::DynamicDylib,

View File

@ -1,42 +0,0 @@
--- rustc-1.59.0-src/Cargo.lock.orig 2022-02-21 18:48:37.000000000 -0800
+++ rustc-1.59.0-src/Cargo.lock 2022-02-22 10:16:10.381962862 -0800
@@ -1935,7 +1935,6 @@
dependencies = [
"cc",
"libc",
- "libssh2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -1968,20 +1967,6 @@
]
[[package]]
-name = "libssh2-sys"
-version = "0.2.23"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca"
-dependencies = [
- "cc",
- "libc",
- "libz-sys",
- "openssl-sys",
- "pkg-config",
- "vcpkg",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-1.59.0-src/vendor/git2/Cargo.toml.orig 2022-02-21 20:14:37.000000000 -0800
+++ rustc-1.59.0-src/vendor/git2/Cargo.toml 2022-02-22 10:12:23.021772490 -0800
@@ -51,7 +51,7 @@
version = "0.1.39"
[features]
-default = ["ssh", "https", "ssh_key_from_memory"]
+default = ["https"]
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
ssh = ["libgit2-sys/ssh"]
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]

View File

@ -1,18 +0,0 @@
--- rustc-1.61.0-src/src/etc/rust-gdb.orig 2022-05-17 18:29:36.000000000 -0700
+++ rustc-1.61.0-src/src/etc/rust-gdb 2022-05-18 11:18:13.732709661 -0700
@@ -14,6 +14,9 @@ fi
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
+RUST_STD_BUILD="@BUILDDIR@/library/"
+RUST_STD_SRC="$RUSTC_SYSROOT/lib/rustlib/src/rust/library/"
+
# Run GDB with the additional arguments that load the pretty printers
# Set the environment variable `RUST_GDB` to overwrite the call to a
# different/specific command (defaults to `gdb`).
@@ -21,4 +24,5 @@ RUST_GDB="${RUST_GDB:-gdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
+ -iex "set substitute-path $RUST_STD_BUILD $RUST_STD_SRC" \
"$@"

View File

@ -1,90 +0,0 @@
--- rustc-1.63.0-src/Cargo.lock.orig 2022-08-10 12:25:16.512185135 -0700
+++ rustc-1.63.0-src/Cargo.lock 2022-08-10 12:25:16.513185114 -0700
@@ -1054,7 +1054,6 @@
dependencies = [
"cc",
"libc",
- "libnghttp2-sys",
"libz-sys",
"openssl-sys",
"pkg-config",
@@ -2160,16 +2159,6 @@
checksum = "7fc7aa29613bd6a620df431842069224d8bc9011086b1db4c0e0cd47fa03ec9a"
[[package]]
-name = "libnghttp2-sys"
-version = "0.1.4+1.41.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
name = "libz-sys"
version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
--- rustc-1.63.0-src/src/tools/cargo/Cargo.toml.orig 2022-08-10 12:25:16.514185093 -0700
+++ rustc-1.63.0-src/src/tools/cargo/Cargo.toml 2022-08-10 12:25:51.441455282 -0700
@@ -22,7 +22,7 @@
cargo-util = { path = "crates/cargo-util", version = "0.2.1" }
crates-io = { path = "crates/crates-io", version = "0.34.0" }
crossbeam-utils = "0.8"
-curl = { version = "0.4.43", features = ["http2"] }
+curl = { version = "0.4.43", features = [] }
curl-sys = "0.4.55"
env_logger = "0.9.0"
pretty_env_logger = { version = "0.4", optional = true }
--- rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs.orig 2022-08-08 15:47:35.000000000 -0700
+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/sources/registry/http_remote.rs 2022-08-10 12:25:16.514185093 -0700
@@ -192,16 +192,8 @@
}
self.fetch_started = true;
- // We've enabled the `http2` feature of `curl` in Cargo, so treat
- // failures here as fatal as it would indicate a build-time problem.
- self.multiplexing = self.config.http_config()?.multiplexing.unwrap_or(true);
-
- self.multi
- .pipelining(false, self.multiplexing)
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood the server with connections
- self.multi.set_max_host_connections(2)?;
+ // Multiplexing is disabled because the system libcurl doesn't support it.
+ self.multiplexing = false;
self.config
.shell()
--- rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2022-08-08 15:47:35.000000000 -0700
+++ rustc-1.63.0-src/src/tools/cargo/src/cargo/core/package.rs 2022-08-10 12:25:16.514185093 -0700
@@ -403,16 +403,9 @@
sources: SourceMap<'cfg>,
config: &'cfg Config,
) -> CargoResult<PackageSet<'cfg>> {
- // We've enabled the `http2` feature of `curl` in Cargo, so treat
- // failures here as fatal as it would indicate a build-time problem.
- let mut multi = Multi::new();
- let multiplexing = config.http_config()?.multiplexing.unwrap_or(true);
- multi
- .pipelining(false, multiplexing)
- .with_context(|| "failed to enable multiplexing/pipelining in curl")?;
-
- // let's not flood crates.io with connections
- multi.set_max_host_connections(2)?;
+ // Multiplexing is disabled because the system libcurl doesn't support it.
+ let multi = Multi::new();
+ let multiplexing = false;
Ok(PackageSet {
packages: package_ids
@@ -658,7 +651,7 @@
macro_rules! try_old_curl {
($e:expr, $msg:expr) => {
let result = $e;
- if cfg!(target_os = "macos") {
+ if cfg!(any(target_os = "linux", target_os = "macos")) {
if let Err(e) = result {
warn!("ignoring libcurl {} error: {}", $msg, e);
}

View File

@ -0,0 +1,21 @@
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
index 9abed30ea6f7..e4bf55df3688 100755
--- a/src/etc/rust-gdb
+++ b/src/etc/rust-gdb
@@ -13,8 +13,6 @@ fi
# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
-# Get the commit hash for path remapping
-RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
# Run GDB with the additional arguments that load the pretty printers
# Set the environment variable `RUST_GDB` to overwrite the call to a
@@ -23,6 +21,6 @@ RUST_GDB="${RUST_GDB:-gdb}"
PYTHONPATH="$PYTHONPATH:$GDB_PYTHON_MODULE_DIRECTORY" exec ${RUST_GDB} \
--directory="$GDB_PYTHON_MODULE_DIRECTORY" \
-iex "add-auto-load-safe-path $GDB_PYTHON_MODULE_DIRECTORY" \
- -iex "set substitute-path /rustc/$RUSTC_COMMIT_HASH $RUSTC_SYSROOT/lib/rustlib/src/rust" \
+ -iex "set substitute-path @BUILDDIR@ $RUSTC_SYSROOT/lib/rustlib/src/rust" \
"$@"

View File

@ -0,0 +1,42 @@
--- 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" ] }

View File

@ -1,2 +1,2 @@
SHA512 (rustc-1.63.0-src.tar.xz) = 0dd3cd1546bd9c1438afe0c4694e1ed80507f6b437674682c0474e13f83457e9ced4560ddeee58602e01837140f9e34a9e24c6828643dd6f613e07755af6997c
SHA512 (wasi-libc-9886d3d6200fcc3726329966860fc058707406cd.tar.gz) = 5b6af0f7133d31c2c068606737eff957126a3045e09c1e95bd2650e0c5637d4797d7036b9beb167829d38d58f6d4199852832f61b0c8836f05e945cd0cf68132
SHA512 (rustc-1.73.0-src.tar.xz) = 75c59680a82cb9d076b9434744a1c65908524ef769293952f5d9c5779d9a9c6fa4d9aa0c7e7d6b7566a21a50a27cd6ae452b5283a4d4606b2fa1acc24dfd8e0c
SHA512 (wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz) = 01e5cc3ebdab239f57816ff80f939fd87a5491a28951daf74b3310b118b4820c098ac9417771c9c6af55ca91d2cabe6498975ab9db4914aba754d87067cd1066

View File

@ -48,7 +48,10 @@ rlJournalStart
rlRun "rpm -ivh $SRPM"
rlRun SPECDIR="$(rpm -E '%{_specdir}')"
rlRun "yum-builddep -y ${SPECDIR}/${PKG_TO_BUILD}.spec ${YUM_SWITCHES}"
# librsvg2 contains dynamic dependencies. builddep needs to be run
# from the srpm (not the spec file) to be able to generate them:
# https://fedoraproject.org/wiki/Changes/DynamicBuildRequires#rpmbuild
rlRun "yum-builddep -y ${SRPM} ${YUM_SWITCHES}"
rlPhaseEnd
rlPhaseStartTest