Skip to content

Commit 6b06289

Browse files
committed
Sync from rust 2fa8b11f0933dae9b4e5d287cc10c989218e8b36
2 parents 829413d + 0700696 commit 6b06289

File tree

6 files changed

+37
-26
lines changed

6 files changed

+37
-26
lines changed

build_system/tests.rs

+28-21
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,34 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
9999
runner.run_out_command("gen_block_iterate", &[]);
100100
}),
101101
TestCase::build_bin_and_run("aot.raw-dylib", "example/raw-dylib.rs", &[]),
102+
TestCase::custom("test.sysroot", &|runner| {
103+
apply_patches(
104+
&runner.dirs,
105+
"sysroot_tests",
106+
&runner.stdlib_source.join("library"),
107+
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
108+
);
109+
110+
SYSROOT_TESTS.clean(&runner.dirs);
111+
112+
let mut target_compiler = runner.target_compiler.clone();
113+
// coretests and alloctests produce a bunch of warnings. When running
114+
// in rust's CI warnings are denied, so we have to override that here.
115+
target_compiler.rustflags.push("--cap-lints=allow".to_owned());
116+
// The standard library may have been compiled with -Zrandomize-layout.
117+
target_compiler.rustflags.extend(["--cfg".to_owned(), "randomized_layouts".to_owned()]);
118+
119+
if runner.is_native {
120+
let mut test_cmd = SYSROOT_TESTS.test(&target_compiler, &runner.dirs);
121+
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests", "--", "-q"]);
122+
spawn_and_wait(test_cmd);
123+
} else {
124+
eprintln!("Cross-Compiling: Not running tests");
125+
let mut build_cmd = SYSROOT_TESTS.build(&target_compiler, &runner.dirs);
126+
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
127+
spawn_and_wait(build_cmd);
128+
}
129+
}),
102130
];
103131

104132
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
@@ -146,27 +174,6 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
146174
spawn_and_wait(build_cmd);
147175
}
148176
}),
149-
TestCase::custom("test.sysroot", &|runner| {
150-
apply_patches(
151-
&runner.dirs,
152-
"sysroot_tests",
153-
&runner.stdlib_source.join("library"),
154-
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
155-
);
156-
157-
SYSROOT_TESTS.clean(&runner.dirs);
158-
159-
if runner.is_native {
160-
let mut test_cmd = SYSROOT_TESTS.test(&runner.target_compiler, &runner.dirs);
161-
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--", "-q"]);
162-
spawn_and_wait(test_cmd);
163-
} else {
164-
eprintln!("Cross-Compiling: Not running tests");
165-
let mut build_cmd = SYSROOT_TESTS.build(&runner.target_compiler, &runner.dirs);
166-
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
167-
spawn_and_wait(build_cmd);
168-
}
169-
}),
170177
TestCase::custom("test.regex", &|runner| {
171178
REGEX_REPO.patch(&runner.dirs);
172179

build_system/utils.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ impl CargoProject {
105105
.arg(self.manifest_path(dirs))
106106
.arg("--target-dir")
107107
.arg(self.target_dir(dirs))
108-
.arg("--locked");
108+
.arg("--locked")
109+
// bootstrap sets both RUSTC and RUSTC_WRAPPER to the same wrapper. RUSTC is already
110+
// respected by the rustc-clif wrapper, but RUSTC_WRAPPER will misinterpret rustc-clif
111+
// as filename, so we need to unset it.
112+
.env_remove("RUSTC_WRAPPER");
109113

110114
if dirs.frozen {
111115
cmd.arg("--frozen");

config.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ aot.issue-59326
3232
aot.neon
3333
aot.gen_block_iterate
3434
aot.raw-dylib
35+
test.sysroot
3536

3637
testsuite.extended_sysroot
3738
test.rust-random/rand
38-
test.sysroot
3939
test.regex
4040
test.portable-simd

src/abi/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
641641
.flat_map(|arg_abi| arg_abi.get_abi_param(fx.tcx).into_iter()),
642642
);
643643

644-
if fx.tcx.sess.target.is_like_osx && fx.tcx.sess.target.arch == "aarch64" {
644+
if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == "aarch64" {
645645
// Add any padding arguments needed for Apple AArch64.
646646
// There's no need to pad the argument list unless variadic arguments are actually being
647647
// passed.

src/constant.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
391391
data.set_align(alloc.align.bytes());
392392

393393
if let Some(section_name) = section_name {
394-
let (segment_name, section_name) = if tcx.sess.target.is_like_osx {
394+
let (segment_name, section_name) = if tcx.sess.target.is_like_darwin {
395395
// See https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCSectionMachO.cpp
396396
let mut parts = section_name.as_str().split(',');
397397
let Some(segment_name) = parts.next() else {

src/debuginfo/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl DebugContext {
5858
// FIXME this should be configurable
5959
// macOS doesn't seem to support DWARF > 3
6060
// 5 version is required for md5 file hash
61-
version: if tcx.sess.target.is_like_osx {
61+
version: if tcx.sess.target.is_like_darwin {
6262
3
6363
} else {
6464
// FIXME change to version 5 once the gdb and lldb shipping with the latest debian

0 commit comments

Comments
 (0)