Skip to content

Commit a4cedec

Browse files
committed
Auto merge of #133032 - GuillaumeGomez:rollup-vqakdmw, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #132010 (ci: Enable full `debuginfo-level=2` in `DEPLOY_ALT`) - #132310 (compiletest: add `max-llvm-major-version` directive) - #132773 (PassWrapper: disable UseOdrIndicator for Asan Win32) - #133013 (compiletest: known-bug / crashes: allow for an "auxiliary" directory to contain files that do not have a "known-bug" directive) - #133027 (Fix a copy-paste issue in the NuttX raw type definition) r? `@ghost` `@rustbot` modify labels: rollup
2 parents dae7ac1 + e6cd869 commit a4cedec

File tree

14 files changed

+92
-13
lines changed

14 files changed

+92
-13
lines changed

compiler/rustc_llvm/llvm-wrapper/PassWrapper.cpp

+11-4
Original file line numberDiff line numberDiff line change
@@ -882,10 +882,12 @@ extern "C" LLVMRustResult LLVMRustOptimize(
882882
SanitizerOptions->SanitizeKernelAddress) {
883883
OptimizerLastEPCallbacks.push_back(
884884
#if LLVM_VERSION_GE(20, 0)
885-
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level,
886-
ThinOrFullLTOPhase phase) {
885+
[SanitizerOptions, TM](ModulePassManager &MPM,
886+
OptimizationLevel Level,
887+
ThinOrFullLTOPhase phase) {
887888
#else
888-
[SanitizerOptions](ModulePassManager &MPM, OptimizationLevel Level) {
889+
[SanitizerOptions, TM](ModulePassManager &MPM,
890+
OptimizationLevel Level) {
889891
#endif
890892
auto CompileKernel = SanitizerOptions->SanitizeKernelAddress;
891893
AddressSanitizerOptions opts = AddressSanitizerOptions{
@@ -895,7 +897,12 @@ extern "C" LLVMRustResult LLVMRustOptimize(
895897
/*UseAfterScope=*/true,
896898
AsanDetectStackUseAfterReturnMode::Runtime,
897899
};
898-
MPM.addPass(AddressSanitizerPass(opts));
900+
MPM.addPass(AddressSanitizerPass(
901+
opts,
902+
/*UseGlobalGC*/ true,
903+
// UseOdrIndicator should be false on windows machines
904+
// https://reviews.llvm.org/D137227
905+
!TM->getTargetTriple().isOSWindows()));
899906
});
900907
}
901908
if (SanitizerOptions->SanitizeHWAddress) {

library/std/src/os/nuttx/raw.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! rtems raw type definitions
1+
//! NuttX raw type definitions
22
33
#![stable(feature = "raw_ext", since = "1.1.0")]
44
#![deprecated(

src/ci/run.sh

+6-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,12 @@ RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --release-channel=$RUST_RELEASE_CHANNE
115115
if [ "$DEPLOY$DEPLOY_ALT" = "1" ]; then
116116
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-llvm-static-stdcpp"
117117
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --set rust.remap-debuginfo"
118-
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level-std=1"
118+
119+
if [ "$DEPLOY_ALT" != "" ]; then
120+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level=2"
121+
else
122+
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --debuginfo-level-std=1"
123+
fi
119124

120125
if [ "$NO_LLVM_ASSERTIONS" = "1" ]; then
121126
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --disable-llvm-assertions"

src/tools/compiletest/src/directive-list.rs

+1
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
120120
"incremental",
121121
"known-bug",
122122
"llvm-cov-flags",
123+
"max-llvm-major-version",
123124
"min-cdb-version",
124125
"min-gdb-version",
125126
"min-lldb-version",

src/tools/compiletest/src/header.rs

+14
Original file line numberDiff line numberDiff line change
@@ -1546,6 +1546,20 @@ fn ignore_llvm(config: &Config, line: &str) -> IgnoreDecision {
15461546
),
15471547
};
15481548
}
1549+
} else if let Some(version_string) =
1550+
config.parse_name_value_directive(line, "max-llvm-major-version")
1551+
{
1552+
let max_version = extract_llvm_version(&version_string);
1553+
// Ignore if actual major version is larger than the maximum required major version.
1554+
if actual_version.major > max_version.major {
1555+
return IgnoreDecision::Ignore {
1556+
reason: format!(
1557+
"ignored when the LLVM version ({actual_version}) is newer than major\
1558+
version {}",
1559+
max_version.major
1560+
),
1561+
};
1562+
}
15491563
} else if let Some(version_string) =
15501564
config.parse_name_value_directive(line, "min-system-llvm-version")
15511565
{

src/tools/compiletest/src/header/tests.rs

+9
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,15 @@ fn llvm_version() {
299299

300300
let config: Config = cfg().llvm_version("10.6.2").build();
301301
assert!(!check_ignore(&config, "//@ exact-llvm-major-version: 10"));
302+
303+
let config: Config = cfg().llvm_version("19.0.0").build();
304+
assert!(!check_ignore(&config, "//@ max-llvm-major-version: 19"));
305+
306+
let config: Config = cfg().llvm_version("19.1.2").build();
307+
assert!(!check_ignore(&config, "//@ max-llvm-major-version: 19"));
308+
309+
let config: Config = cfg().llvm_version("20.0.0").build();
310+
assert!(check_ignore(&config, "//@ max-llvm-major-version: 19"));
302311
}
303312

304313
#[test]

src/tools/tidy/src/known_bug.rs

+16-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,22 @@ use crate::walk::*;
66

77
pub fn check(filepath: &Path, bad: &mut bool) {
88
walk(filepath, |path, _is_dir| filter_not_rust(path), &mut |entry, contents| {
9-
let file = entry.path();
10-
if !contents.lines().any(|line| line.starts_with("//@ known-bug: ")) {
9+
let file: &Path = entry.path();
10+
11+
// files in "auxiliary" do not need to crash by themselves
12+
let test_path_segments =
13+
file.iter().map(|s| s.to_string_lossy().into()).collect::<Vec<String>>();
14+
let test_path_segments_str =
15+
test_path_segments.iter().map(|s| s.as_str()).collect::<Vec<&str>>();
16+
17+
if !matches!(test_path_segments_str[..], [
18+
..,
19+
"tests",
20+
"crashes",
21+
"auxiliary",
22+
_aux_file_rs
23+
]) && !contents.lines().any(|line| line.starts_with("//@ known-bug: "))
24+
{
1125
tidy_error!(
1226
bad,
1327
"{} crash/ice test does not have a \"//@ known-bug: \" directive",

tests/assembly/riscv-soft-abi-with-float-features.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ compile-flags: --target riscv64imac-unknown-none-elf -Ctarget-feature=+f,+d
33
//@ needs-llvm-components: riscv
44
//@ revisions: LLVM-PRE-20 LLVM-POST-20
5-
//@ [LLVM-PRE-20] ignore-llvm-version: 20 - 99
5+
//@ [LLVM-PRE-20] max-llvm-major-version: 19
66
//@ [LLVM-POST-20] min-llvm-version: 20
77

88
#![feature(no_core, lang_items, f16)]

tests/assembly/x86_64-cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ revisions: DEBUG LLVM-PRE-20-OPTIM LLVM-20-OPTIM
22
//@ [DEBUG] compile-flags: -C opt-level=0
33
//@ [LLVM-PRE-20-OPTIM] compile-flags: -C opt-level=3
4-
//@ [LLVM-PRE-20-OPTIM] ignore-llvm-version: 20 - 99
4+
//@ [LLVM-PRE-20-OPTIM] max-llvm-major-version: 19
55
//@ [LLVM-20-OPTIM] compile-flags: -C opt-level=3
66
//@ [LLVM-20-OPTIM] min-llvm-version: 20
77
//@ assembly-output: emit-asm

tests/codegen/branch-protection-old-llvm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//@ [LEAF] compile-flags: -Z branch-protection=pac-ret,leaf
88
//@ [BKEY] compile-flags: -Z branch-protection=pac-ret,b-key
99
//@ compile-flags: --target aarch64-unknown-linux-gnu
10-
//@ ignore-llvm-version: 19 - 99
10+
//@ max-llvm-major-version: 18
1111

1212
#![crate_type = "lib"]
1313
#![feature(no_core, lang_items)]

tests/codegen/call-metadata.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// scalar value.
33

44
//@ compile-flags: -O -C no-prepopulate-passes
5-
//@ ignore-llvm-version: 19 - 99
5+
//@ max-llvm-major-version: 18
66

77
#![crate_type = "lib"]
88

tests/codegen/integer-cmp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//@ revisions: llvm-pre-20 llvm-20
55
//@ [llvm-20] min-llvm-version: 20
6-
//@ [llvm-pre-20] ignore-llvm-version: 20 - 99
6+
//@ [llvm-pre-20] max-llvm-major-version: 19
77
//@ compile-flags: -C opt-level=3
88

99
#![crate_type = "lib"]
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//! Check that crates can be linked together with `-Z sanitizer=address` on msvc.
2+
//! See <https://github.com/rust-lang/rust/issues/124390>.
3+
4+
//@ run-pass
5+
//@ compile-flags:-Zsanitizer=address
6+
//@ aux-build: asan_odr_win-2.rs
7+
//@ only-windows-msvc
8+
9+
extern crate othercrate;
10+
11+
fn main() {
12+
let result = std::panic::catch_unwind(|| {
13+
println!("hello!");
14+
});
15+
assert!(result.is_ok());
16+
17+
othercrate::exposed_func();
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ no-prefer-dynamic
2+
//@ compile-flags: -Z sanitizer=address
3+
#![crate_name = "othercrate"]
4+
#![crate_type = "rlib"]
5+
6+
pub fn exposed_func() {
7+
let result = std::panic::catch_unwind(|| {
8+
println!("hello!");
9+
});
10+
assert!(result.is_ok());
11+
}

0 commit comments

Comments
 (0)