Skip to content

Commit 3fb1b53

Browse files
committed
Auto merge of #144731 - samueltardieu:rollup-36y30k2, r=samueltardieu
Rollup of 4 pull requests Successful merges: - #136840 (Fix linker-plugin-lto only doing thin lto) - #144053 (Remove install Rust script from CI) - #144297 (Make `libtest::ERROR_EXIT_CODE` const public to not redefine it in rustdoc) - #144721 (`std_detect`: Linux 6.16 support for RISC-V) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 64ca23b + 97e2806 commit 3fb1b53

File tree

19 files changed

+203
-50
lines changed

19 files changed

+203
-50
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ jobs:
159159
- name: show the current environment
160160
run: src/ci/scripts/dump-environment.sh
161161

162-
- name: install rust
163-
run: src/ci/scripts/install-rust.sh
164-
165162
- name: install awscli
166163
run: src/ci/scripts/install-awscli.sh
167164

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,9 @@ impl ModuleConfig {
214214
false
215215
),
216216
emit_obj,
217-
emit_thin_lto: sess.opts.unstable_opts.emit_thin_lto,
217+
// thin lto summaries prevent fat lto, so do not emit them if fat
218+
// lto is requested. See PR #136840 for background information.
219+
emit_thin_lto: sess.opts.unstable_opts.emit_thin_lto && sess.lto() != Lto::Fat,
218220
emit_thin_lto_summary: if_regular!(
219221
sess.opts.output_types.contains_key(&OutputType::ThinLinkBitcode),
220222
false

library/std_detect/src/detect/arch/riscv.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ features! {
7373
/// * Zihintpause: `"zihintpause"`
7474
/// * Zihpm: `"zihpm"`
7575
/// * Zimop: `"zimop"`
76+
/// * Zabha: `"zabha"`
7677
/// * Zacas: `"zacas"`
7778
/// * Zawrs: `"zawrs"`
7879
/// * Zfa: `"zfa"`
@@ -195,6 +196,8 @@ features! {
195196
/// "Zaamo" Extension for Atomic Memory Operations
196197
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zawrs: "zawrs";
197198
/// "Zawrs" Extension for Wait-on-Reservation-Set Instructions
199+
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zabha: "zabha";
200+
/// "Zabha" Extension for Byte and Halfword Atomic Memory Operations
198201
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zacas: "zacas";
199202
/// "Zacas" Extension for Atomic Compare-and-Swap (CAS) Instructions
200203
@FEATURE: #[unstable(feature = "stdarch_riscv_feature_detection", issue = "111192")] zam: "zam";

library/std_detect/src/detect/os/linux/riscv.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ use super::super::riscv::imply_features;
1010
use super::auxvec;
1111
use crate::detect::{Feature, bit, cache};
1212

13-
// See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/prctl.h?h=v6.15>
13+
// See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/include/uapi/linux/prctl.h?h=v6.16>
1414
// for runtime status query constants.
1515
const PR_RISCV_V_GET_CONTROL: libc::c_int = 70;
1616
const PR_RISCV_V_VSTATE_CTRL_ON: libc::c_int = 2;
1717
const PR_RISCV_V_VSTATE_CTRL_CUR_MASK: libc::c_int = 3;
1818

19-
// See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h?h=v6.15>
19+
// See <https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwprobe.h?h=v6.16>
2020
// for riscv_hwprobe struct and hardware probing constants.
2121

2222
#[repr(C)]
@@ -98,6 +98,7 @@ const RISCV_HWPROBE_EXT_ZVFBFWMA: u64 = 1 << 54;
9898
const RISCV_HWPROBE_EXT_ZICBOM: u64 = 1 << 55;
9999
const RISCV_HWPROBE_EXT_ZAAMO: u64 = 1 << 56;
100100
const RISCV_HWPROBE_EXT_ZALRSC: u64 = 1 << 57;
101+
const RISCV_HWPROBE_EXT_ZABHA: u64 = 1 << 58;
101102

102103
const RISCV_HWPROBE_KEY_CPUPERF_0: i64 = 5;
103104
const RISCV_HWPROBE_MISALIGNED_FAST: u64 = 3;
@@ -138,7 +139,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
138139
// Use auxiliary vector to enable single-letter ISA extensions.
139140
// The values are part of the platform-specific [asm/hwcap.h][hwcap]
140141
//
141-
// [hwcap]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwcap.h?h=v6.15
142+
// [hwcap]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/riscv/include/uapi/asm/hwcap.h?h=v6.16
142143
let auxv = auxvec::auxv().expect("read auxvec"); // should not fail on RISC-V platform
143144
let mut has_i = bit::test(auxv.hwcap, (b'i' - b'a').into());
144145
#[allow(clippy::eq_op)]
@@ -233,6 +234,7 @@ pub(crate) fn detect_features() -> cache::Initializer {
233234
enable_feature(Feature::zalrsc, test(RISCV_HWPROBE_EXT_ZALRSC));
234235
enable_feature(Feature::zaamo, test(RISCV_HWPROBE_EXT_ZAAMO));
235236
enable_feature(Feature::zawrs, test(RISCV_HWPROBE_EXT_ZAWRS));
237+
enable_feature(Feature::zabha, test(RISCV_HWPROBE_EXT_ZABHA));
236238
enable_feature(Feature::zacas, test(RISCV_HWPROBE_EXT_ZACAS));
237239
enable_feature(Feature::ztso, test(RISCV_HWPROBE_EXT_ZTSO));
238240

library/std_detect/src/detect/os/riscv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub(crate) fn imply_features(mut value: cache::Initializer) -> cache::Initialize
9090
group!(zks == zbkb & zbkc & zbkx & zksed & zksh);
9191
group!(zk == zkn & zkr & zkt);
9292

93-
imply!(zacas => zaamo);
93+
imply!(zabha | zacas => zaamo);
9494
group!(a == zalrsc & zaamo);
9595

9696
group!(b == zba & zbb & zbs);

library/std_detect/tests/cpu-detection.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ fn riscv_linux() {
242242
println!("zalrsc: {}", is_riscv_feature_detected!("zalrsc"));
243243
println!("zaamo: {}", is_riscv_feature_detected!("zaamo"));
244244
println!("zawrs: {}", is_riscv_feature_detected!("zawrs"));
245+
println!("zabha: {}", is_riscv_feature_detected!("zabha"));
245246
println!("zacas: {}", is_riscv_feature_detected!("zacas"));
246247
println!("zam: {}", is_riscv_feature_detected!("zam"));
247248
println!("ztso: {}", is_riscv_feature_detected!("ztso"));

library/test/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ use options::RunStrategy;
8989
use test_result::*;
9090
use time::TestExecTime;
9191

92-
// Process exit code to be used to indicate test failures.
93-
const ERROR_EXIT_CODE: i32 = 101;
92+
/// Process exit code to be used to indicate test failures.
93+
pub const ERROR_EXIT_CODE: i32 = 101;
9494

9595
const SECONDARY_TEST_INVOKER_VAR: &str = "__RUST_TEST_INVOKE";
9696
const SECONDARY_TEST_BENCH_BENCHMARKS_VAR: &str = "__RUST_TEST_BENCH_BENCHMARKS";

src/ci/scripts/install-rust.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/librustdoc/doctest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,8 @@ pub(crate) fn run_tests(
409409
// We ensure temp dir destructor is called.
410410
std::mem::drop(temp_dir);
411411
times.display_times();
412-
// libtest::ERROR_EXIT_CODE is not public but it's the same value.
412+
// FIXME(GuillaumeGomez): Uncomment the next line once #144297 has been merged.
413+
// std::process::exit(test::ERROR_EXIT_CODE);
413414
std::process::exit(101);
414415
}
415416
}

src/tools/run-make-support/src/external_deps/llvm.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,12 @@ pub fn llvm_pdbutil() -> LlvmPdbutil {
6060
LlvmPdbutil::new()
6161
}
6262

63+
/// Construct a new `llvm-as` invocation. This assumes that `llvm-as` is available
64+
/// at `$LLVM_BIN_DIR/llvm-as`.
65+
pub fn llvm_as() -> LlvmAs {
66+
LlvmAs::new()
67+
}
68+
6369
/// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
6470
/// at `$LLVM_BIN_DIR/llvm-dis`.
6571
pub fn llvm_dis() -> LlvmDis {
@@ -135,6 +141,13 @@ pub struct LlvmPdbutil {
135141
cmd: Command,
136142
}
137143

144+
/// A `llvm-as` invocation builder.
145+
#[derive(Debug)]
146+
#[must_use]
147+
pub struct LlvmAs {
148+
cmd: Command,
149+
}
150+
138151
/// A `llvm-dis` invocation builder.
139152
#[derive(Debug)]
140153
#[must_use]
@@ -158,6 +171,7 @@ crate::macros::impl_common_helpers!(LlvmNm);
158171
crate::macros::impl_common_helpers!(LlvmBcanalyzer);
159172
crate::macros::impl_common_helpers!(LlvmDwarfdump);
160173
crate::macros::impl_common_helpers!(LlvmPdbutil);
174+
crate::macros::impl_common_helpers!(LlvmAs);
161175
crate::macros::impl_common_helpers!(LlvmDis);
162176
crate::macros::impl_common_helpers!(LlvmObjcopy);
163177

@@ -441,6 +455,22 @@ impl LlvmObjcopy {
441455
}
442456
}
443457

458+
impl LlvmAs {
459+
/// Construct a new `llvm-as` invocation. This assumes that `llvm-as` is available
460+
/// at `$LLVM_BIN_DIR/llvm-as`.
461+
pub fn new() -> Self {
462+
let llvm_as = llvm_bin_dir().join("llvm-as");
463+
let cmd = Command::new(llvm_as);
464+
Self { cmd }
465+
}
466+
467+
/// Provide an input file.
468+
pub fn input<P: AsRef<Path>>(&mut self, path: P) -> &mut Self {
469+
self.cmd.arg(path.as_ref());
470+
self
471+
}
472+
}
473+
444474
impl LlvmDis {
445475
/// Construct a new `llvm-dis` invocation. This assumes that `llvm-dis` is available
446476
/// at `$LLVM_BIN_DIR/llvm-dis`.

0 commit comments

Comments
 (0)