This commit is contained in:
bjorn3 2025-04-07 19:35:39 +00:00
commit 6b06289a16
6 changed files with 37 additions and 26 deletions

View file

@ -99,6 +99,34 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
runner.run_out_command("gen_block_iterate", &[]);
}),
TestCase::build_bin_and_run("aot.raw-dylib", "example/raw-dylib.rs", &[]),
TestCase::custom("test.sysroot", &|runner| {
apply_patches(
&runner.dirs,
"sysroot_tests",
&runner.stdlib_source.join("library"),
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
);
SYSROOT_TESTS.clean(&runner.dirs);
let mut target_compiler = runner.target_compiler.clone();
// coretests and alloctests produce a bunch of warnings. When running
// in rust's CI warnings are denied, so we have to override that here.
target_compiler.rustflags.push("--cap-lints=allow".to_owned());
// The standard library may have been compiled with -Zrandomize-layout.
target_compiler.rustflags.extend(["--cfg".to_owned(), "randomized_layouts".to_owned()]);
if runner.is_native {
let mut test_cmd = SYSROOT_TESTS.test(&target_compiler, &runner.dirs);
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests", "--", "-q"]);
spawn_and_wait(test_cmd);
} else {
eprintln!("Cross-Compiling: Not running tests");
let mut build_cmd = SYSROOT_TESTS.build(&target_compiler, &runner.dirs);
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
spawn_and_wait(build_cmd);
}
}),
];
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
@ -146,27 +174,6 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
spawn_and_wait(build_cmd);
}
}),
TestCase::custom("test.sysroot", &|runner| {
apply_patches(
&runner.dirs,
"sysroot_tests",
&runner.stdlib_source.join("library"),
&SYSROOT_TESTS_SRC.to_path(&runner.dirs),
);
SYSROOT_TESTS.clean(&runner.dirs);
if runner.is_native {
let mut test_cmd = SYSROOT_TESTS.test(&runner.target_compiler, &runner.dirs);
test_cmd.args(["-p", "coretests", "-p", "alloctests", "--", "-q"]);
spawn_and_wait(test_cmd);
} else {
eprintln!("Cross-Compiling: Not running tests");
let mut build_cmd = SYSROOT_TESTS.build(&runner.target_compiler, &runner.dirs);
build_cmd.args(["-p", "coretests", "-p", "alloctests", "--tests"]);
spawn_and_wait(build_cmd);
}
}),
TestCase::custom("test.regex", &|runner| {
REGEX_REPO.patch(&runner.dirs);

View file

@ -105,7 +105,11 @@ impl CargoProject {
.arg(self.manifest_path(dirs))
.arg("--target-dir")
.arg(self.target_dir(dirs))
.arg("--locked");
.arg("--locked")
// bootstrap sets both RUSTC and RUSTC_WRAPPER to the same wrapper. RUSTC is already
// respected by the rustc-clif wrapper, but RUSTC_WRAPPER will misinterpret rustc-clif
// as filename, so we need to unset it.
.env_remove("RUSTC_WRAPPER");
if dirs.frozen {
cmd.arg("--frozen");

View file

@ -32,9 +32,9 @@ aot.issue-59326
aot.neon
aot.gen_block_iterate
aot.raw-dylib
test.sysroot
testsuite.extended_sysroot
test.rust-random/rand
test.sysroot
test.regex
test.portable-simd

View file

@ -641,7 +641,7 @@ pub(crate) fn codegen_terminator_call<'tcx>(
.flat_map(|arg_abi| arg_abi.get_abi_param(fx.tcx).into_iter()),
);
if fx.tcx.sess.target.is_like_osx && fx.tcx.sess.target.arch == "aarch64" {
if fx.tcx.sess.target.is_like_darwin && fx.tcx.sess.target.arch == "aarch64" {
// Add any padding arguments needed for Apple AArch64.
// There's no need to pad the argument list unless variadic arguments are actually being
// passed.

View file

@ -391,7 +391,7 @@ fn define_all_allocs(tcx: TyCtxt<'_>, module: &mut dyn Module, cx: &mut Constant
data.set_align(alloc.align.bytes());
if let Some(section_name) = section_name {
let (segment_name, section_name) = if tcx.sess.target.is_like_osx {
let (segment_name, section_name) = if tcx.sess.target.is_like_darwin {
// See https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCSectionMachO.cpp
let mut parts = section_name.as_str().split(',');
let Some(segment_name) = parts.next() else {

View file

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