Compare commits
No commits in common. "imports/c8s-stream-rhel8-bootstrap/rust-1.55.0-1.module+el8.6.0+13130+6081e3bb" and "c8-stream-rhel8" have entirely different histories.
imports/c8
...
c8-stream-
|
@ -1 +1,2 @@
|
|||
SOURCES/rustc-1.55.0-src.tar.xz
|
||||
SOURCES/rustc-1.75.0-src.tar.xz
|
||||
SOURCES/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
3fd8c1e1d44f95621499d245d0be00c4945347fb SOURCES/rustc-1.55.0-src.tar.xz
|
||||
9ad7bb54dc9572c103b855cdcc823addbb34d15d SOURCES/rustc-1.75.0-src.tar.xz
|
||||
55eaa32c99cc8ec970f2db2d340a605724589f9b SOURCES/wasi-libc-bd950eb128bff337153de217b11270f948d04bb4.tar.gz
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
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
|
||||
|
||||
---
|
||||
.../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/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 = 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/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 = 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.
|
||||
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 = 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;
|
||||
base.max_atomic_width = Some(64);
|
||||
base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64"]);
|
||||
--
|
||||
2.41.0
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
From eaf7ea1fc339e1ff348ed941ed2e8c4d66f3e458 Mon Sep 17 00:00:00 2001
|
||||
From: Josh Stone <jistone@redhat.com>
|
||||
Date: Thu, 18 Feb 2021 19:14:58 -0800
|
||||
Subject: [PATCH] Revert "Auto merge of #79547 - erikdesjardins:byval,
|
||||
r=nagisa"
|
||||
|
||||
This reverts commit a094ff9590b83c8f94d898f92c2964a5803ded06, reversing
|
||||
changes made to d37afad0cc87bf709ad10c85319296ac53030f03.
|
||||
---
|
||||
compiler/rustc_middle/src/ty/layout.rs | 12 ++++++------
|
||||
...return-value-in-reg.rs => return-value-in-reg.rs} | 4 ++--
|
||||
src/test/codegen/union-abi.rs | 11 +++--------
|
||||
3 files changed, 11 insertions(+), 16 deletions(-)
|
||||
rename src/test/codegen/{arg-return-value-in-reg.rs => return-value-in-reg.rs} (74%)
|
||||
|
||||
diff --git a/compiler/rustc_middle/src/ty/layout.rs b/compiler/rustc_middle/src/ty/layout.rs
|
||||
index b545b92c9252..545f6aee1a21 100644
|
||||
--- a/compiler/rustc_middle/src/ty/layout.rs
|
||||
+++ b/compiler/rustc_middle/src/ty/layout.rs
|
||||
@@ -2849,7 +2849,7 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
|| abi == SpecAbi::RustIntrinsic
|
||||
|| abi == SpecAbi::PlatformIntrinsic
|
||||
{
|
||||
- let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>| {
|
||||
+ let fixup = |arg: &mut ArgAbi<'tcx, Ty<'tcx>>, is_ret: bool| {
|
||||
if arg.is_ignore() {
|
||||
return;
|
||||
}
|
||||
@@ -2887,9 +2887,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
_ => return,
|
||||
}
|
||||
|
||||
- // Pass and return structures up to 2 pointers in size by value, matching `ScalarPair`.
|
||||
- // LLVM will usually pass these in 2 registers, which is more efficient than by-ref.
|
||||
- let max_by_val_size = Pointer.size(cx) * 2;
|
||||
+ // Return structures up to 2 pointers in size by value, matching `ScalarPair`. LLVM
|
||||
+ // will usually return these in 2 registers, which is more efficient than by-ref.
|
||||
+ let max_by_val_size = if is_ret { Pointer.size(cx) * 2 } else { Pointer.size(cx) };
|
||||
let size = arg.layout.size;
|
||||
|
||||
if arg.layout.is_unsized() || size > max_by_val_size {
|
||||
@@ -2901,9 +2901,9 @@ fn adjust_for_abi(&mut self, cx: &C, abi: SpecAbi) {
|
||||
arg.cast_to(Reg { kind: RegKind::Integer, size });
|
||||
}
|
||||
};
|
||||
- fixup(&mut self.ret);
|
||||
+ fixup(&mut self.ret, true);
|
||||
for arg in &mut self.args {
|
||||
- fixup(arg);
|
||||
+ fixup(arg, false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
diff --git a/src/test/codegen/arg-return-value-in-reg.rs b/src/test/codegen/return-value-in-reg.rs
|
||||
similarity index 74%
|
||||
rename from src/test/codegen/arg-return-value-in-reg.rs
|
||||
rename to src/test/codegen/return-value-in-reg.rs
|
||||
index a69291d47821..4bc0136c5e32 100644
|
||||
--- a/src/test/codegen/arg-return-value-in-reg.rs
|
||||
+++ b/src/test/codegen/return-value-in-reg.rs
|
||||
@@ -1,4 +1,4 @@
|
||||
-//! Check that types of up to 128 bits are passed and returned by-value instead of via pointer.
|
||||
+//! This test checks that types of up to 128 bits are returned by-value instead of via out-pointer.
|
||||
|
||||
// compile-flags: -C no-prepopulate-passes -O
|
||||
// only-x86_64
|
||||
@@ -11,7 +11,7 @@ pub struct S {
|
||||
c: u32,
|
||||
}
|
||||
|
||||
-// CHECK: define i128 @modify(i128{{( %0)?}})
|
||||
+// CHECK: define i128 @modify(%S* noalias nocapture dereferenceable(16) %s)
|
||||
#[no_mangle]
|
||||
pub fn modify(s: S) -> S {
|
||||
S { a: s.a + s.a, b: s.b + s.b, c: s.c + s.c }
|
||||
diff --git a/src/test/codegen/union-abi.rs b/src/test/codegen/union-abi.rs
|
||||
index f282fd237054..afea01e9a2d0 100644
|
||||
--- a/src/test/codegen/union-abi.rs
|
||||
+++ b/src/test/codegen/union-abi.rs
|
||||
@@ -63,16 +63,11 @@ pub union UnionU128{a:u128}
|
||||
#[no_mangle]
|
||||
pub fn test_UnionU128(_: UnionU128) -> UnionU128 { loop {} }
|
||||
|
||||
-pub union UnionU128x2{a:(u128, u128)}
|
||||
-// CHECK: define void @test_UnionU128x2(i128 %_1.0, i128 %_1.1)
|
||||
-#[no_mangle]
|
||||
-pub fn test_UnionU128x2(_: UnionU128x2) { loop {} }
|
||||
-
|
||||
#[repr(C)]
|
||||
-pub union CUnionU128x2{a:(u128, u128)}
|
||||
-// CHECK: define void @test_CUnionU128x2(%CUnionU128x2* {{.*}} %_1)
|
||||
+pub union CUnionU128{a:u128}
|
||||
+// CHECK: define void @test_CUnionU128(%CUnionU128* {{.*}} %_1)
|
||||
#[no_mangle]
|
||||
-pub fn test_CUnionU128x2(_: CUnionU128x2) { loop {} }
|
||||
+pub fn test_CUnionU128(_: CUnionU128) { loop {} }
|
||||
|
||||
pub union UnionBool { b:bool }
|
||||
// CHECK: define zeroext i1 @test_UnionBool(i8 %b)
|
||||
--
|
||||
2.29.2
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From 9ac837c237568a6c1c5f0e979fcce208cd9c926a 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 4c954a1e567c..15c4f1bda5eb 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".to_owned()),
|
||||
+ linker: Some("lld".to_owned()),
|
||||
lld_flavor: LldFlavor::Wasm,
|
||||
linker_is_gnu: false,
|
||||
|
||||
--
|
||||
2.31.1
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
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,
|
||||
|
||||
- // 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/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,
|
||||
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/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
|
||||
|
|
@ -0,0 +1,102 @@
|
|||
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/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)
|
||||
|
||||
+# 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/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)> {
|
||||
+ 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/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,
|
||||
+ 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;
|
||||
}
|
||||
+ if triple.contains("-musl") || triple.contains("-wasi") || triple.contains("-windows-gnu") {
|
||||
+ target.self_contained = true;
|
||||
+ }
|
||||
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",
|
||||
+ self_contained: Option<bool> = "self-contained",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
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)
|
||||
}
|
||||
|
||||
+ /// 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
|
||||
|
|
@ -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
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
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/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 dd9d277fb775..3d0f0502f255 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
|
||||
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() {
|
||||
@@ -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));
|
||||
}
|
||||
+ 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 f04799482c83..25410b37ba24 100644
|
||||
--- a/compiler/rustc_target/src/spec/mod.rs
|
||||
+++ b/compiler/rustc_target/src/spec/mod.rs
|
||||
@@ -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,
|
||||
+ 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,
|
||||
@@ -2352,6 +2353,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/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.
|
||||
- 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
|
||||
|
|
@ -0,0 +1,181 @@
|
|||
# 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 /usr/bin/rustc
|
||||
%__rustdoc /usr/bin/rustdoc
|
||||
|
||||
# rustflags_opt_level: default optimization level
|
||||
#
|
||||
# It corresponds to the "-Copt-level" rustc command line option.
|
||||
%rustflags_opt_level 3
|
||||
|
||||
# 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)
|
||||
#
|
||||
# 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
|
||||
}
|
||||
|
||||
# __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 \
|
||||
[build]\
|
||||
rustc = "%{__rustc}"\
|
||||
rustdoc = "%{__rustdoc}"\
|
||||
\
|
||||
[env]\
|
||||
CFLAGS = "%{build_cflags}"\
|
||||
CXXFLAGS = "%{build_cxxflags}"\
|
||||
LDFLAGS = "%{build_ldflags}"\
|
||||
\
|
||||
[install]\
|
||||
root = "%{buildroot}%{_prefix}"\
|
||||
\
|
||||
[term]\
|
||||
verbose = true\
|
||||
EOF\
|
||||
%if 0%{-V:1}\
|
||||
%{__tar} -xoaf %{S:%{-V*}}\
|
||||
cat >> .cargo/config << EOF \
|
||||
\
|
||||
[source.crates-io]\
|
||||
replace-with = "vendored-sources"\
|
||||
\
|
||||
[source.vendored-sources]\
|
||||
directory = "./vendor"\
|
||||
EOF\
|
||||
%endif\
|
||||
)
|
||||
|
||||
# __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}
|
||||
}
|
||||
|
||||
# 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_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 \
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
--- rustc-1.48.0-src/Cargo.lock.orig 2020-11-16 06:01:53.000000000 -0800
|
||||
+++ rustc-1.48.0-src/Cargo.lock 2020-11-16 09:27:44.425104404 -0800
|
||||
@@ -1676,7 +1676,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libssh2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -1693,20 +1692,6 @@
|
||||
]
|
||||
|
||||
[[package]]
|
||||
-name = "libssh2-sys"
|
||||
-version = "0.2.19"
|
||||
-source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
-checksum = "ca46220853ba1c512fc82826d0834d87b06bcd3c2a42241b7de72f3d2fe17056"
|
||||
-dependencies = [
|
||||
- "cc",
|
||||
- "libc",
|
||||
- "libz-sys",
|
||||
- "openssl-sys",
|
||||
- "pkg-config",
|
||||
- "vcpkg",
|
||||
-]
|
||||
-
|
||||
-[[package]]
|
||||
name = "libz-sys"
|
||||
version = "1.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- rustc-1.48.0-src/vendor/git2/Cargo.toml.orig 2020-11-16 06:27:49.000000000 -0800
|
||||
+++ rustc-1.48.0-src/vendor/git2/Cargo.toml 2020-11-16 09:27:44.425104404 -0800
|
||||
@@ -49,7 +49,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"]
|
|
@ -1,19 +0,0 @@
|
|||
--- rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs.orig 2021-03-09 10:40:09.755485845 -0800
|
||||
+++ rustc-beta-src/compiler/rustc_codegen_ssa/src/back/link.rs 2021-03-09 10:44:51.257426181 -0800
|
||||
@@ -1279,11 +1279,13 @@
|
||||
}
|
||||
|
||||
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 explicity specified.
|
||||
+ let explicit_pic = matches!(sess.opts.cg.relocation_model, Some(RelocModel::Pic));
|
||||
+ 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) => LinkOutputKind::DynamicPicExe,
|
||||
+ (CrateType::Executable, false, true) => LinkOutputKind::DynamicPicExe,
|
||||
(CrateType::Executable, false, _) => LinkOutputKind::DynamicNoPicExe,
|
||||
- (CrateType::Executable, true, RelocModel::Pic) => LinkOutputKind::StaticPicExe,
|
||||
+ (CrateType::Executable, true, true) => LinkOutputKind::StaticPicExe,
|
||||
(CrateType::Executable, true, _) => LinkOutputKind::StaticNoPicExe,
|
||||
(_, true, _) => LinkOutputKind::StaticDylib,
|
||||
(_, false, _) => LinkOutputKind::DynamicDylib,
|
|
@ -1,66 +0,0 @@
|
|||
--- rustc-1.55.0-src/Cargo.lock.orig 2021-09-07 16:33:21.672163689 -0700
|
||||
+++ rustc-1.55.0-src/Cargo.lock 2021-09-07 16:33:21.673163668 -0700
|
||||
@@ -877,7 +877,6 @@
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
- "libnghttp2-sys",
|
||||
"libz-sys",
|
||||
"openssl-sys",
|
||||
"pkg-config",
|
||||
@@ -1907,16 +1906,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.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
--- rustc-1.55.0-src/src/tools/cargo/Cargo.toml.orig 2021-09-07 16:33:21.673163668 -0700
|
||||
+++ rustc-1.55.0-src/src/tools/cargo/Cargo.toml 2021-09-07 16:34:59.637068004 -0700
|
||||
@@ -25,7 +25,7 @@
|
||||
cargo-util = { path = "crates/cargo-util", version = "0.1.1" }
|
||||
crates-io = { path = "crates/crates-io", version = "0.33.0" }
|
||||
crossbeam-utils = "0.8"
|
||||
-curl = { version = "0.4.38", features = ["http2"] }
|
||||
+curl = { version = "0.4.38", features = [] }
|
||||
curl-sys = "0.4.45"
|
||||
env_logger = "0.9.0"
|
||||
pretty_env_logger = { version = "0.4", optional = true }
|
||||
--- rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs.orig 2021-09-06 11:42:51.000000000 -0700
|
||||
+++ rustc-1.55.0-src/src/tools/cargo/src/cargo/core/package.rs 2021-09-07 16:33:21.674163646 -0700
|
||||
@@ -417,14 +417,8 @@
|
||||
// Also note that pipelining is disabled as curl authors have indicated
|
||||
// that it's buggy, and we've empirically seen that it's buggy with HTTP
|
||||
// proxies.
|
||||
- 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)?;
|
||||
+ let multi = Multi::new();
|
||||
+ let multiplexing = false;
|
||||
|
||||
Ok(PackageSet {
|
||||
packages: package_ids
|
||||
@@ -597,7 +591,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);
|
||||
}
|
|
@ -1,898 +0,0 @@
|
|||
From e84e42e37057d51f68075845c92ad817c1893857 Mon Sep 17 00:00:00 2001
|
||||
From: bors <bors@rust-lang.org>
|
||||
Date: Sat, 21 Aug 2021 09:25:28 +0000
|
||||
Subject: [PATCH] Auto merge of #87570 - nikic:llvm-13, r=nagisa
|
||||
|
||||
Upgrade to LLVM 13
|
||||
|
||||
Work in progress update to LLVM 13. Main changes:
|
||||
|
||||
* InlineAsm diagnostics reported using SrcMgr diagnostic kind are now handled. Previously these used a separate diag handler.
|
||||
* Codegen tests are updated for additional attributes.
|
||||
* Some data layouts have changed.
|
||||
* Switch `#[used]` attribute from `llvm.used` to `llvm.compiler.used` to avoid SHF_GNU_RETAIN flag introduced in https://reviews.llvm.org/D97448, which appears to trigger a bug in older versions of gold.
|
||||
* Set `LLVM_INCLUDE_TESTS=OFF` to avoid Python 3.6 requirement.
|
||||
|
||||
Upstream issues:
|
||||
|
||||
* ~~https://bugs.llvm.org/show_bug.cgi?id=51210 (InlineAsm diagnostic reporting for module asm)~~ Fixed by https://github.com/llvm/llvm-project/commit/1558bb80c01b695ce12642527cbfccf16cf54ece.
|
||||
* ~~https://bugs.llvm.org/show_bug.cgi?id=51476 (Miscompile on AArch64 due to incorrect comparison elimination)~~ Fixed by https://github.com/llvm/llvm-project/commit/81b106584f2baf33e09be2362c35c1bf2f6bfe94.
|
||||
* https://bugs.llvm.org/show_bug.cgi?id=51207 (Can't set custom section flags anymore). Problematic change reverted in our fork, https://reviews.llvm.org/D107216 posted for upstream revert.
|
||||
* https://bugs.llvm.org/show_bug.cgi?id=51211 (Regression in codegen for #83623). This is an optimization regression that we may likely have to eat for this release. The fix for #83623 was based on an incorrect premise, and this needs to be properly addressed in the MergeICmps pass.
|
||||
|
||||
The [compile-time impact](https://perf.rust-lang.org/compare.html?start=ef9549b6c0efb7525c9b012148689c8d070f9bc0&end=0983094463497eec22d550dad25576a894687002) is mixed, but quite positive as LLVM upgrades go.
|
||||
|
||||
The LLVM 13 final release is scheduled for Sep 21st. The current nightly is scheduled for stable release on Oct 21st.
|
||||
|
||||
r? `@ghost`
|
||||
|
||||
(cherry picked from commit db002a06ae9154a35d410550bc5132df883d7baa)
|
||||
---
|
||||
compiler/rustc_codegen_llvm/src/back/write.rs | 43 +--------
|
||||
compiler/rustc_codegen_llvm/src/base.rs | 8 +-
|
||||
compiler/rustc_codegen_llvm/src/consts.rs | 15 ++-
|
||||
compiler/rustc_codegen_llvm/src/context.rs | 55 ++++++++---
|
||||
compiler/rustc_codegen_llvm/src/lib.rs | 2 +-
|
||||
.../rustc_codegen_llvm/src/llvm/diagnostic.rs | 94 +++++++++++++++----
|
||||
compiler/rustc_codegen_llvm/src/llvm/ffi.rs | 7 +-
|
||||
compiler/rustc_codegen_ssa/src/traits/misc.rs | 2 +
|
||||
.../rustc_codegen_ssa/src/traits/statics.rs | 18 ++--
|
||||
compiler/rustc_feature/src/accepted.rs | 2 +-
|
||||
.../rustc_llvm/llvm-wrapper/RustWrapper.cpp | 20 +++-
|
||||
.../src/spec/powerpc64_unknown_linux_gnu.rs | 2 +-
|
||||
.../src/spec/powerpc64_unknown_linux_musl.rs | 2 +-
|
||||
.../src/spec/powerpc64_wrs_vxworks.rs | 2 +-
|
||||
.../src/spec/powerpc64le_unknown_linux_gnu.rs | 2 +-
|
||||
.../spec/powerpc64le_unknown_linux_musl.rs | 2 +-
|
||||
.../src/spec/wasm32_unknown_emscripten.rs | 2 +-
|
||||
.../src/spec/wasm32_unknown_unknown.rs | 2 +-
|
||||
compiler/rustc_target/src/spec/wasm32_wasi.rs | 2 +-
|
||||
.../src/spec/wasm64_unknown_unknown.rs | 2 +-
|
||||
src/bootstrap/native.rs | 1 +
|
||||
src/test/codegen/array-equality.rs | 4 +-
|
||||
.../codegen/issue-83623-SIMD-PartialEq.rs | 46 ---------
|
||||
src/test/codegen/repeat-trusted-len.rs | 2 +-
|
||||
.../coverage-llvmir/Makefile | 2 -
|
||||
.../coverage-llvmir/filecheck.testprog.txt | 18 ++--
|
||||
src/test/ui/llvm-asm/issue-69092.rs | 4 +-
|
||||
src/test/ui/llvm-asm/issue-69092.stderr | 4 +-
|
||||
29 files changed, 200 insertions(+), 167 deletions(-)
|
||||
delete mode 100644 src/test/codegen/issue-83623-SIMD-PartialEq.rs
|
||||
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/back/write.rs b/compiler/rustc_codegen_llvm/src/back/write.rs
|
||||
index 5b4a187a1d56..791604a18273 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/back/write.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/back/write.rs
|
||||
@@ -296,39 +296,8 @@ fn report_inline_asm(
|
||||
}
|
||||
let (cgcx, _) = *(user as *const (&CodegenContext<LlvmCodegenBackend>, &Handler));
|
||||
|
||||
- // Recover the post-substitution assembly code from LLVM for better
|
||||
- // diagnostics.
|
||||
- let mut have_source = false;
|
||||
- let mut buffer = String::new();
|
||||
- let mut level = llvm::DiagnosticLevel::Error;
|
||||
- let mut loc = 0;
|
||||
- let mut ranges = [0; 8];
|
||||
- let mut num_ranges = ranges.len() / 2;
|
||||
- let msg = llvm::build_string(|msg| {
|
||||
- buffer = llvm::build_string(|buffer| {
|
||||
- have_source = llvm::LLVMRustUnpackSMDiagnostic(
|
||||
- diag,
|
||||
- msg,
|
||||
- buffer,
|
||||
- &mut level,
|
||||
- &mut loc,
|
||||
- ranges.as_mut_ptr(),
|
||||
- &mut num_ranges,
|
||||
- );
|
||||
- })
|
||||
- .expect("non-UTF8 inline asm");
|
||||
- })
|
||||
- .expect("non-UTF8 SMDiagnostic");
|
||||
-
|
||||
- let source = have_source.then(|| {
|
||||
- let mut spans = vec![InnerSpan::new(loc as usize, loc as usize)];
|
||||
- for i in 0..num_ranges {
|
||||
- spans.push(InnerSpan::new(ranges[i * 2] as usize, ranges[i * 2 + 1] as usize));
|
||||
- }
|
||||
- (buffer, spans)
|
||||
- });
|
||||
-
|
||||
- report_inline_asm(cgcx, msg, level, cookie, source);
|
||||
+ let smdiag = llvm::diagnostic::SrcMgrDiagnostic::unpack(diag);
|
||||
+ report_inline_asm(cgcx, smdiag.message, smdiag.level, cookie, smdiag.source);
|
||||
}
|
||||
|
||||
unsafe extern "C" fn diagnostic_handler(info: &DiagnosticInfo, user: *mut c_void) {
|
||||
@@ -339,13 +308,7 @@ fn report_inline_asm(
|
||||
|
||||
match llvm::diagnostic::Diagnostic::unpack(info) {
|
||||
llvm::diagnostic::InlineAsm(inline) => {
|
||||
- report_inline_asm(
|
||||
- cgcx,
|
||||
- llvm::twine_to_string(inline.message),
|
||||
- inline.level,
|
||||
- inline.cookie,
|
||||
- None,
|
||||
- );
|
||||
+ report_inline_asm(cgcx, inline.message, inline.level, inline.cookie, inline.source);
|
||||
}
|
||||
|
||||
llvm::diagnostic::Optimization(opt) => {
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/base.rs b/compiler/rustc_codegen_llvm/src/base.rs
|
||||
index cc3cbea4def5..a6bdbd11899d 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/base.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/base.rs
|
||||
@@ -157,16 +157,18 @@ fn module_codegen(tcx: TyCtxt<'_>, cgu_name: Symbol) -> ModuleCodegen<ModuleLlvm
|
||||
}
|
||||
|
||||
// Finalize code coverage by injecting the coverage map. Note, the coverage map will
|
||||
- // also be added to the `llvm.used` variable, created next.
|
||||
+ // also be added to the `llvm.compiler.used` variable, created next.
|
||||
if cx.sess().instrument_coverage() {
|
||||
cx.coverageinfo_finalize();
|
||||
}
|
||||
|
||||
- // Create the llvm.used variable
|
||||
- // This variable has type [N x i8*] and is stored in the llvm.metadata section
|
||||
+ // Create the llvm.used and llvm.compiler.used variables.
|
||||
if !cx.used_statics().borrow().is_empty() {
|
||||
cx.create_used_variable()
|
||||
}
|
||||
+ if !cx.compiler_used_statics().borrow().is_empty() {
|
||||
+ cx.create_compiler_used_variable()
|
||||
+ }
|
||||
|
||||
// Finalize debuginfo
|
||||
if cx.sess().opts.debuginfo != DebugInfo::None {
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/consts.rs b/compiler/rustc_codegen_llvm/src/consts.rs
|
||||
index 3ca295f4a7e8..e1baf95e1d9e 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/consts.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/consts.rs
|
||||
@@ -474,7 +474,13 @@ fn codegen_static(&self, def_id: DefId, is_mutable: bool) {
|
||||
}
|
||||
|
||||
if attrs.flags.contains(CodegenFnAttrFlags::USED) {
|
||||
- self.add_used_global(g);
|
||||
+ // The semantics of #[used] in Rust only require the symbol to make it into the
|
||||
+ // object file. It is explicitly allowed for the linker to strip the symbol if it
|
||||
+ // is dead. As such, use llvm.compiler.used instead of llvm.used.
|
||||
+ // Additionally, https://reviews.llvm.org/D97448 in LLVM 13 started emitting unique
|
||||
+ // sections with SHF_GNU_RETAIN flag for llvm.used symbols, which may trigger bugs
|
||||
+ // in some versions of the gold linker.
|
||||
+ self.add_compiler_used_global(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -484,4 +490,11 @@ fn add_used_global(&self, global: &'ll Value) {
|
||||
let cast = unsafe { llvm::LLVMConstPointerCast(global, self.type_i8p()) };
|
||||
self.used_statics.borrow_mut().push(cast);
|
||||
}
|
||||
+
|
||||
+ /// Add a global value to a list to be stored in the `llvm.compiler.used` variable,
|
||||
+ /// an array of i8*.
|
||||
+ fn add_compiler_used_global(&self, global: &'ll Value) {
|
||||
+ let cast = unsafe { llvm::LLVMConstPointerCast(global, self.type_i8p()) };
|
||||
+ self.compiler_used_statics.borrow_mut().push(cast);
|
||||
+ }
|
||||
}
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/context.rs b/compiler/rustc_codegen_llvm/src/context.rs
|
||||
index 59259857b4b0..027fb2b7e00c 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/context.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/context.rs
|
||||
@@ -74,6 +74,10 @@ pub struct CodegenCx<'ll, 'tcx> {
|
||||
/// See <https://llvm.org/docs/LangRef.html#the-llvm-used-global-variable> for details
|
||||
pub used_statics: RefCell<Vec<&'ll Value>>,
|
||||
|
||||
+ /// Statics that will be placed in the llvm.compiler.used variable
|
||||
+ /// See <https://llvm.org/docs/LangRef.html#the-llvm-compiler-used-global-variable> for details
|
||||
+ pub compiler_used_statics: RefCell<Vec<&'ll Value>>,
|
||||
+
|
||||
pub lltypes: RefCell<FxHashMap<(Ty<'tcx>, Option<VariantIdx>), &'ll Type>>,
|
||||
pub scalar_lltypes: RefCell<FxHashMap<Ty<'tcx>, &'ll Type>>,
|
||||
pub pointee_infos: RefCell<FxHashMap<(Ty<'tcx>, Size), Option<PointeeInfo>>>,
|
||||
@@ -101,10 +105,6 @@ fn to_llvm_tls_model(tls_model: TlsModel) -> llvm::ThreadLocalMode {
|
||||
}
|
||||
}
|
||||
|
||||
-fn strip_powerpc64_vectors(data_layout: String) -> String {
|
||||
- data_layout.replace("-v256:256:256-v512:512:512", "")
|
||||
-}
|
||||
-
|
||||
pub unsafe fn create_module(
|
||||
tcx: TyCtxt<'_>,
|
||||
llcx: &'ll llvm::Context,
|
||||
@@ -116,7 +116,18 @@ pub unsafe fn create_module(
|
||||
|
||||
let mut target_data_layout = sess.target.data_layout.clone();
|
||||
if llvm_util::get_version() < (12, 0, 0) && sess.target.arch == "powerpc64" {
|
||||
- target_data_layout = strip_powerpc64_vectors(target_data_layout);
|
||||
+ target_data_layout = target_data_layout.replace("-v256:256:256-v512:512:512", "");
|
||||
+ }
|
||||
+ if llvm_util::get_version() < (13, 0, 0) {
|
||||
+ if sess.target.arch == "powerpc64" {
|
||||
+ target_data_layout = target_data_layout.replace("-S128", "");
|
||||
+ }
|
||||
+ if sess.target.arch == "wasm32" {
|
||||
+ target_data_layout = "e-m:e-p:32:32-i64:64-n32:64-S128".to_string();
|
||||
+ }
|
||||
+ if sess.target.arch == "wasm64" {
|
||||
+ target_data_layout = "e-m:e-p:64:64-i64:64-n32:64-S128".to_string();
|
||||
+ }
|
||||
}
|
||||
|
||||
// Ensure the data-layout values hardcoded remain the defaults.
|
||||
@@ -304,6 +315,7 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
|
||||
const_globals: Default::default(),
|
||||
statics_to_rauw: RefCell::new(Vec::new()),
|
||||
used_statics: RefCell::new(Vec::new()),
|
||||
+ compiler_used_statics: RefCell::new(Vec::new()),
|
||||
lltypes: Default::default(),
|
||||
scalar_lltypes: Default::default(),
|
||||
pointee_infos: Default::default(),
|
||||
@@ -326,6 +338,18 @@ impl<'ll, 'tcx> CodegenCx<'ll, 'tcx> {
|
||||
pub fn coverage_context(&'a self) -> Option<&'a coverageinfo::CrateCoverageContext<'ll, 'tcx>> {
|
||||
self.coverage_cx.as_ref()
|
||||
}
|
||||
+
|
||||
+ fn create_used_variable_impl(&self, name: &'static CStr, values: &[&'ll Value]) {
|
||||
+ let section = cstr!("llvm.metadata");
|
||||
+ let array = self.const_array(&self.type_ptr_to(self.type_i8()), values);
|
||||
+
|
||||
+ unsafe {
|
||||
+ let g = llvm::LLVMAddGlobal(self.llmod, self.val_ty(array), name.as_ptr());
|
||||
+ llvm::LLVMSetInitializer(g, array);
|
||||
+ llvm::LLVMRustSetLinkage(g, llvm::Linkage::AppendingLinkage);
|
||||
+ llvm::LLVMSetSection(g, section.as_ptr());
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
impl MiscMethods<'tcx> for CodegenCx<'ll, 'tcx> {
|
||||
@@ -416,6 +440,10 @@ fn used_statics(&self) -> &RefCell<Vec<&'ll Value>> {
|
||||
&self.used_statics
|
||||
}
|
||||
|
||||
+ fn compiler_used_statics(&self) -> &RefCell<Vec<&'ll Value>> {
|
||||
+ &self.compiler_used_statics
|
||||
+ }
|
||||
+
|
||||
fn set_frame_pointer_type(&self, llfn: &'ll Value) {
|
||||
attributes::set_frame_pointer_type(self, llfn)
|
||||
}
|
||||
@@ -426,17 +454,14 @@ fn apply_target_cpu_attr(&self, llfn: &'ll Value) {
|
||||
}
|
||||
|
||||
fn create_used_variable(&self) {
|
||||
- let name = cstr!("llvm.used");
|
||||
- let section = cstr!("llvm.metadata");
|
||||
- let array =
|
||||
- self.const_array(&self.type_ptr_to(self.type_i8()), &*self.used_statics.borrow());
|
||||
+ self.create_used_variable_impl(cstr!("llvm.used"), &*self.used_statics.borrow());
|
||||
+ }
|
||||
|
||||
- unsafe {
|
||||
- let g = llvm::LLVMAddGlobal(self.llmod, self.val_ty(array), name.as_ptr());
|
||||
- llvm::LLVMSetInitializer(g, array);
|
||||
- llvm::LLVMRustSetLinkage(g, llvm::Linkage::AppendingLinkage);
|
||||
- llvm::LLVMSetSection(g, section.as_ptr());
|
||||
- }
|
||||
+ fn create_compiler_used_variable(&self) {
|
||||
+ self.create_used_variable_impl(
|
||||
+ cstr!("llvm.compiler.used"),
|
||||
+ &*self.compiler_used_statics.borrow(),
|
||||
+ );
|
||||
}
|
||||
|
||||
fn declare_c_main(&self, fn_type: Self::Type) -> Option<Self::Function> {
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/lib.rs b/compiler/rustc_codegen_llvm/src/lib.rs
|
||||
index aa4db1622b23..1e6e5252b25d 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/lib.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/lib.rs
|
||||
@@ -352,8 +352,8 @@ fn llmod(&self) -> &llvm::Module {
|
||||
impl Drop for ModuleLlvm {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
- llvm::LLVMContextDispose(&mut *(self.llcx as *mut _));
|
||||
llvm::LLVMRustDisposeTargetMachine(&mut *(self.tm as *mut _));
|
||||
+ llvm::LLVMContextDispose(&mut *(self.llcx as *mut _));
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/llvm/diagnostic.rs b/compiler/rustc_codegen_llvm/src/llvm/diagnostic.rs
|
||||
index ccd3e42e458f..36aa022d7465 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/llvm/diagnostic.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/llvm/diagnostic.rs
|
||||
@@ -6,7 +6,8 @@
|
||||
use crate::value::Value;
|
||||
use libc::c_uint;
|
||||
|
||||
-use super::{DiagnosticInfo, Twine};
|
||||
+use super::{DiagnosticInfo, SMDiagnostic};
|
||||
+use rustc_span::InnerSpan;
|
||||
|
||||
#[derive(Copy, Clone)]
|
||||
pub enum OptimizationDiagnosticKind {
|
||||
@@ -86,36 +87,91 @@ unsafe fn unpack(kind: OptimizationDiagnosticKind, di: &'ll DiagnosticInfo) -> S
|
||||
}
|
||||
}
|
||||
|
||||
-#[derive(Copy, Clone)]
|
||||
-pub struct InlineAsmDiagnostic<'ll> {
|
||||
+pub struct SrcMgrDiagnostic {
|
||||
+ pub level: super::DiagnosticLevel,
|
||||
+ pub message: String,
|
||||
+ pub source: Option<(String, Vec<InnerSpan>)>,
|
||||
+}
|
||||
+
|
||||
+impl SrcMgrDiagnostic {
|
||||
+ pub unsafe fn unpack(diag: &SMDiagnostic) -> SrcMgrDiagnostic {
|
||||
+ // Recover the post-substitution assembly code from LLVM for better
|
||||
+ // diagnostics.
|
||||
+ let mut have_source = false;
|
||||
+ let mut buffer = String::new();
|
||||
+ let mut level = super::DiagnosticLevel::Error;
|
||||
+ let mut loc = 0;
|
||||
+ let mut ranges = [0; 8];
|
||||
+ let mut num_ranges = ranges.len() / 2;
|
||||
+ let message = super::build_string(|message| {
|
||||
+ buffer = super::build_string(|buffer| {
|
||||
+ have_source = super::LLVMRustUnpackSMDiagnostic(
|
||||
+ diag,
|
||||
+ message,
|
||||
+ buffer,
|
||||
+ &mut level,
|
||||
+ &mut loc,
|
||||
+ ranges.as_mut_ptr(),
|
||||
+ &mut num_ranges,
|
||||
+ );
|
||||
+ })
|
||||
+ .expect("non-UTF8 inline asm");
|
||||
+ })
|
||||
+ .expect("non-UTF8 SMDiagnostic");
|
||||
+
|
||||
+ SrcMgrDiagnostic {
|
||||
+ message,
|
||||
+ level,
|
||||
+ source: have_source.then(|| {
|
||||
+ let mut spans = vec![InnerSpan::new(loc as usize, loc as usize)];
|
||||
+ for i in 0..num_ranges {
|
||||
+ spans.push(InnerSpan::new(ranges[i * 2] as usize, ranges[i * 2 + 1] as usize));
|
||||
+ }
|
||||
+ (buffer, spans)
|
||||
+ }),
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[derive(Clone)]
|
||||
+pub struct InlineAsmDiagnostic {
|
||||
pub level: super::DiagnosticLevel,
|
||||
pub cookie: c_uint,
|
||||
- pub message: &'ll Twine,
|
||||
- pub instruction: Option<&'ll Value>,
|
||||
+ pub message: String,
|
||||
+ pub source: Option<(String, Vec<InnerSpan>)>,
|
||||
}
|
||||
|
||||
-impl InlineAsmDiagnostic<'ll> {
|
||||
- unsafe fn unpack(di: &'ll DiagnosticInfo) -> Self {
|
||||
+impl InlineAsmDiagnostic {
|
||||
+ unsafe fn unpackInlineAsm(di: &'ll DiagnosticInfo) -> Self {
|
||||
let mut cookie = 0;
|
||||
let mut message = None;
|
||||
- let mut instruction = None;
|
||||
let mut level = super::DiagnosticLevel::Error;
|
||||
|
||||
- super::LLVMRustUnpackInlineAsmDiagnostic(
|
||||
- di,
|
||||
- &mut level,
|
||||
- &mut cookie,
|
||||
- &mut message,
|
||||
- &mut instruction,
|
||||
- );
|
||||
+ super::LLVMRustUnpackInlineAsmDiagnostic(di, &mut level, &mut cookie, &mut message);
|
||||
|
||||
- InlineAsmDiagnostic { level, cookie, message: message.unwrap(), instruction }
|
||||
+ InlineAsmDiagnostic {
|
||||
+ level,
|
||||
+ cookie,
|
||||
+ message: super::twine_to_string(message.unwrap()),
|
||||
+ source: None,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ unsafe fn unpackSrcMgr(di: &'ll DiagnosticInfo) -> Self {
|
||||
+ let mut cookie = 0;
|
||||
+ let smdiag = SrcMgrDiagnostic::unpack(super::LLVMRustGetSMDiagnostic(di, &mut cookie));
|
||||
+ InlineAsmDiagnostic {
|
||||
+ level: smdiag.level,
|
||||
+ cookie,
|
||||
+ message: smdiag.message,
|
||||
+ source: smdiag.source,
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
pub enum Diagnostic<'ll> {
|
||||
Optimization(OptimizationDiagnostic<'ll>),
|
||||
- InlineAsm(InlineAsmDiagnostic<'ll>),
|
||||
+ InlineAsm(InlineAsmDiagnostic),
|
||||
PGO(&'ll DiagnosticInfo),
|
||||
Linker(&'ll DiagnosticInfo),
|
||||
Unsupported(&'ll DiagnosticInfo),
|
||||
@@ -130,7 +186,7 @@ pub unsafe fn unpack(di: &'ll DiagnosticInfo) -> Self {
|
||||
let kind = super::LLVMRustGetDiagInfoKind(di);
|
||||
|
||||
match kind {
|
||||
- Dk::InlineAsm => InlineAsm(InlineAsmDiagnostic::unpack(di)),
|
||||
+ Dk::InlineAsm => InlineAsm(InlineAsmDiagnostic::unpackInlineAsm(di)),
|
||||
|
||||
Dk::OptimizationRemark => {
|
||||
Optimization(OptimizationDiagnostic::unpack(OptimizationRemark, di))
|
||||
@@ -162,6 +218,8 @@ pub unsafe fn unpack(di: &'ll DiagnosticInfo) -> Self {
|
||||
Dk::Linker => Linker(di),
|
||||
Dk::Unsupported => Unsupported(di),
|
||||
|
||||
+ Dk::SrcMgr => InlineAsm(InlineAsmDiagnostic::unpackSrcMgr(di)),
|
||||
+
|
||||
_ => UnknownDiagnostic(di),
|
||||
}
|
||||
}
|
||||
diff --git a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
|
||||
index 68d566cca095..7d5388b9abb8 100644
|
||||
--- a/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
|
||||
+++ b/compiler/rustc_codegen_llvm/src/llvm/ffi.rs
|
||||
@@ -490,6 +490,7 @@ pub enum DiagnosticKind {
|
||||
PGOProfile,
|
||||
Linker,
|
||||
Unsupported,
|
||||
+ SrcMgr,
|
||||
}
|
||||
|
||||
/// LLVMRustDiagnosticLevel
|
||||
@@ -2258,13 +2259,17 @@ pub fn LLVMRustUnpackInlineAsmDiagnostic(
|
||||
level_out: &mut DiagnosticLevel,
|
||||
cookie_out: &mut c_uint,
|
||||
message_out: &mut Option<&'a Twine>,
|
||||
- instruction_out: &mut Option<&'a Value>,
|
||||
);
|
||||
|
||||
#[allow(improper_ctypes)]
|
||||
pub fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString);
|
||||
pub fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind;
|
||||
|
||||
+ pub fn LLVMRustGetSMDiagnostic(
|
||||
+ DI: &'a DiagnosticInfo,
|
||||
+ cookie_out: &mut c_uint,
|
||||
+ ) -> &'a SMDiagnostic;
|
||||
+
|
||||
pub fn LLVMRustSetInlineAsmDiagnosticHandler(
|
||||
C: &Context,
|
||||
H: InlineAsmDiagHandler,
|
||||
diff --git a/compiler/rustc_codegen_ssa/src/traits/misc.rs b/compiler/rustc_codegen_ssa/src/traits/misc.rs
|
||||
index 46f2adbe5520..4266e42ec2b5 100644
|
||||
--- a/compiler/rustc_codegen_ssa/src/traits/misc.rs
|
||||
+++ b/compiler/rustc_codegen_ssa/src/traits/misc.rs
|
||||
@@ -16,9 +16,11 @@ fn vtables(
|
||||
fn sess(&self) -> &Session;
|
||||
fn codegen_unit(&self) -> &'tcx CodegenUnit<'tcx>;
|
||||
fn used_statics(&self) -> &RefCell<Vec<Self::Value>>;
|
||||
+ fn compiler_used_statics(&self) -> &RefCell<Vec<Self::Value>>;
|
||||
fn set_frame_pointer_type(&self, llfn: Self::Function);
|
||||
fn apply_target_cpu_attr(&self, llfn: Self::Function);
|
||||
fn create_used_variable(&self);
|
||||
+ fn create_compiler_used_variable(&self);
|
||||
/// Declares the extern "C" main function for the entry point. Returns None if the symbol already exists.
|
||||
fn declare_c_main(&self, fn_type: Self::Type) -> Option<Self::Function>;
|
||||
}
|
||||
diff --git a/compiler/rustc_codegen_ssa/src/traits/statics.rs b/compiler/rustc_codegen_ssa/src/traits/statics.rs
|
||||
index 817fc02d166a..a2a3cb56c780 100644
|
||||
--- a/compiler/rustc_codegen_ssa/src/traits/statics.rs
|
||||
+++ b/compiler/rustc_codegen_ssa/src/traits/statics.rs
|
||||
@@ -6,17 +6,15 @@ pub trait StaticMethods: BackendTypes {
|
||||
fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value;
|
||||
fn codegen_static(&self, def_id: DefId, is_mutable: bool);
|
||||
|
||||
- /// Mark the given global value as "used", to prevent a backend from potentially removing a
|
||||
- /// static variable that may otherwise appear unused.
|
||||
- ///
|
||||
- /// Static variables in Rust can be annotated with the `#[used]` attribute to direct the `rustc`
|
||||
- /// compiler to mark the variable as a "used global".
|
||||
- ///
|
||||
- /// ```no_run
|
||||
- /// #[used]
|
||||
- /// static FOO: u32 = 0;
|
||||
- /// ```
|
||||
+ /// Mark the given global value as "used", to prevent the compiler and linker from potentially
|
||||
+ /// removing a static variable that may otherwise appear unused.
|
||||
fn add_used_global(&self, global: Self::Value);
|
||||
+
|
||||
+ /// Same as add_used_global(), but only prevent the compiler from potentially removing an
|
||||
+ /// otherwise unused symbol. The linker is still permitted to drop it.
|
||||
+ ///
|
||||
+ /// This corresponds to the semantics of the `#[used]` attribute.
|
||||
+ fn add_compiler_used_global(&self, global: Self::Value);
|
||||
}
|
||||
|
||||
pub trait StaticBuilderMethods: BackendTypes {
|
||||
diff --git a/compiler/rustc_feature/src/accepted.rs b/compiler/rustc_feature/src/accepted.rs
|
||||
index 95504723e7b2..690a6f541ff3 100644
|
||||
--- a/compiler/rustc_feature/src/accepted.rs
|
||||
+++ b/compiler/rustc_feature/src/accepted.rs
|
||||
@@ -178,7 +178,7 @@ macro_rules! declare_features {
|
||||
/// Allows annotating functions conforming to `fn(&PanicInfo) -> !` with `#[panic_handler]`.
|
||||
/// This defines the behavior of panics.
|
||||
(accepted, panic_handler, "1.30.0", Some(44489), None),
|
||||
- /// Allows `#[used]` to preserve symbols (see llvm.used).
|
||||
+ /// Allows `#[used]` to preserve symbols (see llvm.compiler.used).
|
||||
(accepted, used, "1.30.0", Some(40289), None),
|
||||
/// Allows `crate` in paths.
|
||||
(accepted, crate_in_paths, "1.30.0", Some(45477), None),
|
||||
diff --git a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
index 4cdc8a4155bc..fa47dc9caa0b 100644
|
||||
--- a/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
+++ b/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
|
||||
@@ -1114,15 +1114,13 @@ extern "C" void
|
||||
LLVMRustUnpackInlineAsmDiagnostic(LLVMDiagnosticInfoRef DI,
|
||||
LLVMRustDiagnosticLevel *LevelOut,
|
||||
unsigned *CookieOut,
|
||||
- LLVMTwineRef *MessageOut,
|
||||
- LLVMValueRef *InstructionOut) {
|
||||
+ LLVMTwineRef *MessageOut) {
|
||||
// Undefined to call this not on an inline assembly diagnostic!
|
||||
llvm::DiagnosticInfoInlineAsm *IA =
|
||||
static_cast<llvm::DiagnosticInfoInlineAsm *>(unwrap(DI));
|
||||
|
||||
*CookieOut = IA->getLocCookie();
|
||||
*MessageOut = wrap(&IA->getMsgStr());
|
||||
- *InstructionOut = wrap(IA->getInstruction());
|
||||
|
||||
switch (IA->getSeverity()) {
|
||||
case DS_Error:
|
||||
@@ -1165,6 +1163,7 @@ enum class LLVMRustDiagnosticKind {
|
||||
PGOProfile,
|
||||
Linker,
|
||||
Unsupported,
|
||||
+ SrcMgr,
|
||||
};
|
||||
|
||||
static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
||||
@@ -1193,6 +1192,10 @@ static LLVMRustDiagnosticKind toRust(DiagnosticKind Kind) {
|
||||
return LLVMRustDiagnosticKind::Linker;
|
||||
case DK_Unsupported:
|
||||
return LLVMRustDiagnosticKind::Unsupported;
|
||||
+#if LLVM_VERSION_GE(13, 0)
|
||||
+ case DK_SrcMgr:
|
||||
+ return LLVMRustDiagnosticKind::SrcMgr;
|
||||
+#endif
|
||||
default:
|
||||
return (Kind >= DK_FirstRemark && Kind <= DK_LastRemark)
|
||||
? LLVMRustDiagnosticKind::OptimizationRemarkOther
|
||||
@@ -1280,6 +1283,17 @@ extern "C" void LLVMRustSetInlineAsmDiagnosticHandler(
|
||||
#endif
|
||||
}
|
||||
|
||||
+extern "C" LLVMSMDiagnosticRef LLVMRustGetSMDiagnostic(
|
||||
+ LLVMDiagnosticInfoRef DI, unsigned *Cookie) {
|
||||
+#if LLVM_VERSION_GE(13, 0)
|
||||
+ llvm::DiagnosticInfoSrcMgr *SM = static_cast<llvm::DiagnosticInfoSrcMgr *>(unwrap(DI));
|
||||
+ *Cookie = SM->getLocCookie();
|
||||
+ return wrap(&SM->getSMDiag());
|
||||
+#else
|
||||
+ report_fatal_error("Shouldn't get called on older versions");
|
||||
+#endif
|
||||
+}
|
||||
+
|
||||
extern "C" bool LLVMRustUnpackSMDiagnostic(LLVMSMDiagnosticRef DRef,
|
||||
RustStringRef MessageOut,
|
||||
RustStringRef BufferOut,
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
|
||||
index 559a1a40868f..f10d4d49bb90 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_gnu.rs
|
||||
@@ -14,7 +14,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
|
||||
+ data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
|
||||
arch: "powerpc64".to_string(),
|
||||
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
|
||||
index f1190b159aba..611621727bd1 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64_unknown_linux_musl.rs
|
||||
@@ -10,7 +10,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-musl".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
|
||||
+ data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
|
||||
arch: "powerpc64".to_string(),
|
||||
options: TargetOptions { endian: Endian::Big, mcount: "_mcount".to_string(), ..base },
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs b/compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
|
||||
index 3ebc5469e0a8..9c63997ce2f9 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64_wrs_vxworks.rs
|
||||
@@ -10,7 +10,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "powerpc64-unknown-linux-gnu".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "E-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
|
||||
+ data_layout: "E-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
|
||||
arch: "powerpc64".to_string(),
|
||||
options: TargetOptions { endian: Endian::Big, ..base },
|
||||
}
|
||||
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 76f70e474f07..f645eceadfe3 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_gnu.rs
|
||||
@@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "powerpc64le-unknown-linux-gnu".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
|
||||
+ data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
|
||||
arch: "powerpc64".to_string(),
|
||||
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
|
||||
index 42c49103b3b4..934371fb2211 100644
|
||||
--- a/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
|
||||
+++ b/compiler/rustc_target/src/spec/powerpc64le_unknown_linux_musl.rs
|
||||
@@ -9,7 +9,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "powerpc64le-unknown-linux-musl".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "e-m:e-i64:64-n32:64-v256:256:256-v512:512:512".to_string(),
|
||||
+ data_layout: "e-m:e-i64:64-n32:64-S128-v256:256:256-v512:512:512".to_string(),
|
||||
arch: "powerpc64".to_string(),
|
||||
options: TargetOptions { mcount: "_mcount".to_string(), ..base },
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
|
||||
index 302139395d31..86b1a7552335 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm32_unknown_emscripten.rs
|
||||
@@ -43,7 +43,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "wasm32-unknown-emscripten".to_string(),
|
||||
pointer_width: 32,
|
||||
- data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
|
||||
+ data_layout: "e-m:e-p:32:32-i64:64-f128:64-n32:64-S128-ni:1:10:20".to_string(),
|
||||
arch: "wasm32".to_string(),
|
||||
options: opts,
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
|
||||
index 834c4dbfc05f..134c6803b15d 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm32_unknown_unknown.rs
|
||||
@@ -54,7 +54,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "wasm32-unknown-unknown".to_string(),
|
||||
pointer_width: 32,
|
||||
- data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
|
||||
+ data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128-ni:1:10:20".to_string(),
|
||||
arch: "wasm32".to_string(),
|
||||
options,
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/wasm32_wasi.rs b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
index a6b12d2ee8f6..2dab206dc760 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm32_wasi.rs
|
||||
@@ -109,7 +109,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "wasm32-wasi".to_string(),
|
||||
pointer_width: 32,
|
||||
- data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128".to_string(),
|
||||
+ data_layout: "e-m:e-p:32:32-i64:64-n32:64-S128-ni:1:10:20".to_string(),
|
||||
arch: "wasm32".to_string(),
|
||||
options,
|
||||
}
|
||||
diff --git a/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs b/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
|
||||
index 8bfb229d77f6..fb6526c0e720 100644
|
||||
--- a/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
|
||||
+++ b/compiler/rustc_target/src/spec/wasm64_unknown_unknown.rs
|
||||
@@ -32,7 +32,7 @@ pub fn target() -> Target {
|
||||
Target {
|
||||
llvm_target: "wasm64-unknown-unknown".to_string(),
|
||||
pointer_width: 64,
|
||||
- data_layout: "e-m:e-p:64:64-i64:64-n32:64-S128".to_string(),
|
||||
+ data_layout: "e-m:e-p:64:64-i64:64-n32:64-S128-ni:1:10:20".to_string(),
|
||||
arch: "wasm64".to_string(),
|
||||
options,
|
||||
}
|
||||
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs
|
||||
index 1be414b29a1a..63a252154b90 100644
|
||||
--- a/src/bootstrap/native.rs
|
||||
+++ b/src/bootstrap/native.rs
|
||||
@@ -174,6 +174,7 @@ fn run(self, builder: &Builder<'_>) -> PathBuf {
|
||||
.define("LLVM_INCLUDE_EXAMPLES", "OFF")
|
||||
.define("LLVM_INCLUDE_DOCS", "OFF")
|
||||
.define("LLVM_INCLUDE_BENCHMARKS", "OFF")
|
||||
+ .define("LLVM_INCLUDE_TESTS", "OFF")
|
||||
.define("LLVM_ENABLE_TERMINFO", "OFF")
|
||||
.define("LLVM_ENABLE_LIBEDIT", "OFF")
|
||||
.define("LLVM_ENABLE_BINDINGS", "OFF")
|
||||
diff --git a/src/test/codegen/array-equality.rs b/src/test/codegen/array-equality.rs
|
||||
index 4b60fa4b0bff..fefc232b4904 100644
|
||||
--- a/src/test/codegen/array-equality.rs
|
||||
+++ b/src/test/codegen/array-equality.rs
|
||||
@@ -29,7 +29,7 @@
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: bitcast
|
||||
// CHECK-NEXT: bitcast
|
||||
- // CHECK-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(i8* nonnull dereferenceable(18) %{{.+}}, i8* nonnull dereferenceable(18) %{{.+}}, i64 18)
|
||||
+ // CHECK-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(i8* {{.*}} dereferenceable(18) %{{.+}}, i8* {{.*}} dereferenceable(18) %{{.+}}, i64 18)
|
||||
// CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
|
||||
// CHECK-NEXT: ret i1 %[[EQ]]
|
||||
a == b
|
||||
@@ -41,7 +41,7 @@
|
||||
// CHECK-NEXT: start:
|
||||
// CHECK-NEXT: bitcast
|
||||
// CHECK-NEXT: bitcast
|
||||
- // CHECK-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(i8* nonnull dereferenceable(2468) %{{.+}}, i8* nonnull dereferenceable(2468) %{{.+}}, i64 2468)
|
||||
+ // CHECK-NEXT: %[[CMP:.+]] = tail call i32 @{{bcmp|memcmp}}(i8* {{.*}} dereferenceable(2468) %{{.+}}, i8* {{.*}} dereferenceable(2468) %{{.+}}, i64 2468)
|
||||
// CHECK-NEXT: %[[EQ:.+]] = icmp eq i32 %[[CMP]], 0
|
||||
// CHECK-NEXT: ret i1 %[[EQ]]
|
||||
a == b
|
||||
diff --git a/src/test/codegen/issue-83623-SIMD-PartialEq.rs b/src/test/codegen/issue-83623-SIMD-PartialEq.rs
|
||||
deleted file mode 100644
|
||||
index b22b7f52402d..000000000000
|
||||
--- a/src/test/codegen/issue-83623-SIMD-PartialEq.rs
|
||||
+++ /dev/null
|
||||
@@ -1,46 +0,0 @@
|
||||
-// This test checks that jumps generated by logical operators can be optimized away
|
||||
-
|
||||
-// compile-flags: -Copt-level=3
|
||||
-// only-64bit
|
||||
-
|
||||
-#![crate_type="lib"]
|
||||
-
|
||||
-pub struct Blueprint {
|
||||
- pub fuel_tank_size: u32,
|
||||
- pub payload: u32,
|
||||
- pub wheel_diameter: u32,
|
||||
- pub wheel_width: u32,
|
||||
- pub storage: u32,
|
||||
-}
|
||||
-
|
||||
-// && chains should not prevent SIMD optimizations for primitives
|
||||
-impl PartialEq for Blueprint{
|
||||
- fn eq(&self, other: &Self)->bool{
|
||||
- // CHECK-NOT: call{{.*}}bcmp
|
||||
- // CHECK-NOT: call{{.*}}memcmp
|
||||
- // CHECK-NOT: br {{.*}}
|
||||
- self.fuel_tank_size == other.fuel_tank_size
|
||||
- && self.payload == other.payload
|
||||
- && self.wheel_diameter == other.wheel_diameter
|
||||
- && self.wheel_width == other.wheel_width
|
||||
- && self.storage == other.storage
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-#[derive(PartialEq)]
|
||||
-pub struct Blueprint2 {
|
||||
- pub fuel_tank_size: u32,
|
||||
- pub payload: u32,
|
||||
- pub wheel_diameter: u32,
|
||||
- pub wheel_width: u32,
|
||||
- pub storage: u32,
|
||||
-}
|
||||
-
|
||||
-// Derived PartialEq should not generate jumps and should use SIMD
|
||||
-#[no_mangle]
|
||||
-pub fn partial_eq_should_not_jump(a: &Blueprint2, b:&Blueprint2)->bool{
|
||||
- // CHECK-NOT: call{{.*}}bcmp
|
||||
- // CHECK-NOT: call{{.*}}memcmp
|
||||
- // CHECK-NOT: br {{.*}}
|
||||
- a==b
|
||||
-}
|
||||
diff --git a/src/test/codegen/repeat-trusted-len.rs b/src/test/codegen/repeat-trusted-len.rs
|
||||
index 9e904fc82ab4..cb2d0ef809af 100644
|
||||
--- a/src/test/codegen/repeat-trusted-len.rs
|
||||
+++ b/src/test/codegen/repeat-trusted-len.rs
|
||||
@@ -8,6 +8,6 @@
|
||||
// CHECK-LABEL: @repeat_take_collect
|
||||
#[no_mangle]
|
||||
pub fn repeat_take_collect() -> Vec<u8> {
|
||||
-// CHECK: call void @llvm.memset.p0i8.i{{[0-9]+}}(i8* {{(nonnull )?}}align 1{{.*}} %{{[0-9]+}}, i8 42, i{{[0-9]+}} 100000, i1 false)
|
||||
+// CHECK: call void @llvm.memset.p0i8.i{{[0-9]+}}(i8* {{.*}}align 1{{.*}} %{{[0-9]+}}, i8 42, i{{[0-9]+}} 100000, i1 false)
|
||||
iter::repeat(42).take(100000).collect()
|
||||
}
|
||||
diff --git a/src/test/run-make-fulldeps/coverage-llvmir/Makefile b/src/test/run-make-fulldeps/coverage-llvmir/Makefile
|
||||
index 7d9121ee2f83..1ff1ffcc4b0b 100644
|
||||
--- a/src/test/run-make-fulldeps/coverage-llvmir/Makefile
|
||||
+++ b/src/test/run-make-fulldeps/coverage-llvmir/Makefile
|
||||
@@ -22,7 +22,6 @@ DEFINE_INTERNAL=define internal
|
||||
ifdef IS_WINDOWS
|
||||
LLVM_FILECHECK_OPTIONS=\
|
||||
-check-prefixes=CHECK,WINDOWS \
|
||||
- -DPRIVATE_GLOBAL='internal global' \
|
||||
-DDEFINE_INTERNAL='$(DEFINE_INTERNAL)' \
|
||||
-DCOMDAT_IF_SUPPORTED='$(COMDAT_IF_SUPPORTED)' \
|
||||
-DINSTR_PROF_DATA='.lprfd$$M' \
|
||||
@@ -36,7 +35,6 @@ ifdef IS_WINDOWS
|
||||
else
|
||||
LLVM_FILECHECK_OPTIONS=\
|
||||
-check-prefixes=CHECK \
|
||||
- -DPRIVATE_GLOBAL='private global' \
|
||||
-DDEFINE_INTERNAL='$(DEFINE_INTERNAL)' \
|
||||
-DCOMDAT_IF_SUPPORTED='$(COMDAT_IF_SUPPORTED)' \
|
||||
-DINSTR_PROF_DATA='$(DATA_SECTION_PREFIX)__llvm_prf_data$(INSTR_PROF_DATA_SUFFIX)' \
|
||||
diff --git a/src/test/run-make-fulldeps/coverage-llvmir/filecheck.testprog.txt b/src/test/run-make-fulldeps/coverage-llvmir/filecheck.testprog.txt
|
||||
index a312ec48e849..8e5f21046877 100644
|
||||
--- a/src/test/run-make-fulldeps/coverage-llvmir/filecheck.testprog.txt
|
||||
+++ b/src/test/run-make-fulldeps/coverage-llvmir/filecheck.testprog.txt
|
||||
@@ -11,27 +11,25 @@ CHECK-SAME: section "[[INSTR_PROF_COVMAP]]", align 8
|
||||
|
||||
WINDOWS: @__llvm_profile_runtime = external global i32
|
||||
|
||||
-CHECK: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = [[PRIVATE_GLOBAL]]
|
||||
-CHECK-SAME: section "[[INSTR_PROF_CNTS]]", align 8
|
||||
+CHECK: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = {{private|internal}} global
|
||||
+CHECK-SAME: section "[[INSTR_PROF_CNTS]]"{{.*}}, align 8
|
||||
|
||||
-CHECK: @__profd__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = [[PRIVATE_GLOBAL]]
|
||||
+CHECK: @__profd__R{{[a-zA-Z0-9_]+}}testprog14will_be_called = {{private|internal}} global
|
||||
CHECK-SAME: @__profc__R{{[a-zA-Z0-9_]+}}testprog14will_be_called,
|
||||
-CHECK-SAME: section "[[INSTR_PROF_DATA]]", align 8
|
||||
+CHECK-SAME: section "[[INSTR_PROF_DATA]]"{{.*}}, align 8
|
||||
|
||||
-CHECK: @__profc__R{{[a-zA-Z0-9_]+}}testprog4main = [[PRIVATE_GLOBAL]]
|
||||
-CHECK-SAME: section "[[INSTR_PROF_CNTS]]", align 8
|
||||
+CHECK: @__profc__R{{[a-zA-Z0-9_]+}}testprog4main = {{private|internal}} global
|
||||
+CHECK-SAME: section "[[INSTR_PROF_CNTS]]"{{.*}}, align 8
|
||||
|
||||
-CHECK: @__profd__R{{[a-zA-Z0-9_]+}}testprog4main = [[PRIVATE_GLOBAL]]
|
||||
+CHECK: @__profd__R{{[a-zA-Z0-9_]+}}testprog4main = {{private|internal}} global
|
||||
CHECK-SAME: @__profc__R{{[a-zA-Z0-9_]+}}testprog4main,
|
||||
-CHECK-SAME: section "[[INSTR_PROF_DATA]]", align 8
|
||||
+CHECK-SAME: section "[[INSTR_PROF_DATA]]"{{.*}}, align 8
|
||||
|
||||
CHECK: @__llvm_prf_nm = private constant
|
||||
CHECK-SAME: section "[[INSTR_PROF_NAME]]", align 1
|
||||
|
||||
CHECK: @llvm.used = appending global
|
||||
CHECK-SAME: i8* bitcast ({ {{.*}} }* @__llvm_coverage_mapping to i8*)
|
||||
-WINDOWS-SAME: i8* bitcast (i32 ()* @__llvm_profile_runtime_user to i8*)
|
||||
-CHECK-SAME: i8* bitcast ({ {{.*}} }* @__profd__R{{[a-zA-Z0-9_]*}}testprog4main to i8*)
|
||||
CHECK-SAME: i8* getelementptr inbounds ({{.*}}* @__llvm_prf_nm, i32 0, i32 0)
|
||||
CHECK-SAME: section "llvm.metadata"
|
||||
|
||||
diff --git a/src/test/ui/llvm-asm/issue-69092.rs b/src/test/ui/llvm-asm/issue-69092.rs
|
||||
index 96c019b760e9..8260e7204686 100644
|
||||
--- a/src/test/ui/llvm-asm/issue-69092.rs
|
||||
+++ b/src/test/ui/llvm-asm/issue-69092.rs
|
||||
@@ -1,10 +1,12 @@
|
||||
// build-fail
|
||||
// ignore-emscripten no asm! support
|
||||
+// The error message differs slightly between LLVM versions
|
||||
+// min-llvm-version: 13.0
|
||||
// Regression test for #69092
|
||||
|
||||
#![feature(llvm_asm)]
|
||||
|
||||
fn main() {
|
||||
unsafe { llvm_asm!(".ascii \"Xen\0\""); }
|
||||
- //~^ ERROR: expected string in '.ascii' directive
|
||||
+ //~^ ERROR: expected string
|
||||
}
|
||||
diff --git a/src/test/ui/llvm-asm/issue-69092.stderr b/src/test/ui/llvm-asm/issue-69092.stderr
|
||||
index 2ca86cf7c1b9..9bce1c0b346f 100644
|
||||
--- a/src/test/ui/llvm-asm/issue-69092.stderr
|
||||
+++ b/src/test/ui/llvm-asm/issue-69092.stderr
|
||||
@@ -1,5 +1,5 @@
|
||||
-error: expected string in '.ascii' directive
|
||||
- --> $DIR/issue-69092.rs:8:14
|
||||
+error: expected string
|
||||
+ --> $DIR/issue-69092.rs:10:14
|
||||
|
|
||||
LL | unsafe { llvm_asm!(".ascii \"Xen\0\""); }
|
||||
| ^
|
||||
--
|
||||
2.33.0
|
||||
|
|
@ -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" \
|
||||
"$@"
|
||||
|
|
@ -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" ] }
|
908
SPECS/rust.spec
908
SPECS/rust.spec
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue