From 9835e2ae736235810b4ea1c162ca5e65c547e770 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 18 May 2024 04:49:50 +0200 Subject: Merging upstream version 1.71.1+dfsg1. Signed-off-by: Daniel Baumann --- .../rustc_codegen_cranelift/scripts/cargo-clif.rs | 2 +- .../rustc_codegen_cranelift/scripts/rustc-clif.rs | 8 ++- .../scripts/rustdoc-clif.rs | 8 ++- .../scripts/test_rustc_tests.sh | 72 +++++++++++++++++++--- 4 files changed, 75 insertions(+), 15 deletions(-) (limited to 'compiler/rustc_codegen_cranelift/scripts') diff --git a/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs b/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs index 939a1f1ca..e2db7d03a 100644 --- a/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/cargo-clif.rs @@ -64,7 +64,7 @@ fn main() { }; #[cfg(unix)] - Command::new("cargo").args(args).exec(); + panic!("Failed to spawn cargo: {}", Command::new("cargo").args(args).exec()); #[cfg(not(unix))] std::process::exit( diff --git a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs index b9bba7f2e..ab496a4a6 100644 --- a/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/rustc-clif.rs @@ -15,22 +15,24 @@ fn main() { env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX, ); - let mut args = std::env::args_os().skip(1).collect::>(); + let passed_args = std::env::args_os().skip(1).collect::>(); + let mut args = vec![]; args.push(OsString::from("-Cpanic=abort")); args.push(OsString::from("-Zpanic-abort-tests")); let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); codegen_backend_arg.push(cg_clif_dylib_path); args.push(codegen_backend_arg); - if !args.contains(&OsString::from("--sysroot")) { + if !passed_args.contains(&OsString::from("--sysroot")) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } + args.extend(passed_args); // Ensure that the right toolchain is used env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME")); #[cfg(unix)] - Command::new("rustc").args(args).exec(); + panic!("Failed to spawn rustc: {}", Command::new("rustc").args(args).exec()); #[cfg(not(unix))] std::process::exit( diff --git a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs index 167631eaf..545844446 100644 --- a/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs +++ b/compiler/rustc_codegen_cranelift/scripts/rustdoc-clif.rs @@ -15,22 +15,24 @@ fn main() { env::consts::DLL_PREFIX.to_string() + "rustc_codegen_cranelift" + env::consts::DLL_SUFFIX, ); - let mut args = std::env::args_os().skip(1).collect::>(); + let passed_args = std::env::args_os().skip(1).collect::>(); + let mut args = vec![]; args.push(OsString::from("-Cpanic=abort")); args.push(OsString::from("-Zpanic-abort-tests")); let mut codegen_backend_arg = OsString::from("-Zcodegen-backend="); codegen_backend_arg.push(cg_clif_dylib_path); args.push(codegen_backend_arg); - if !args.contains(&OsString::from("--sysroot")) { + if !passed_args.contains(&OsString::from("--sysroot")) { args.push(OsString::from("--sysroot")); args.push(OsString::from(sysroot.to_str().unwrap())); } + args.extend(passed_args); // Ensure that the right toolchain is used env::set_var("RUSTUP_TOOLCHAIN", env!("TOOLCHAIN_NAME")); #[cfg(unix)] - Command::new("rustdoc").args(args).exec(); + panic!("Failed to spawn rustdoc: {}", Command::new("rustdoc").args(args).exec()); #[cfg(not(unix))] std::process::exit( diff --git a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh index 20dcb4cf3..1329d3ea0 100755 --- a/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh +++ b/compiler/rustc_codegen_cranelift/scripts/test_rustc_tests.sh @@ -10,7 +10,8 @@ pushd rust command -v rg >/dev/null 2>&1 || cargo install ripgrep -rm -r tests/ui/{extern/,unsized-locals/,lto/,linkage*} || true +# FIXME add needs-asm-support to all tests in tests/ui/asm +rm -r tests/ui/{unsized-locals/,lto/,linkage*} || true for test in $(rg --files-with-matches "lto|// needs-asm-support|// needs-unwind" tests/{codegen-units,ui,incremental}); do rm $test done @@ -27,13 +28,24 @@ rm tests/ui/parser/unclosed-delimiter-in-dep.rs # submodule contains //~ERROR # ================ # requires stack unwinding +# FIXME add needs-unwind to these tests rm tests/incremental/change_crate_dep_kind.rs rm tests/incremental/issue-80691-bad-eval-cache.rs # -Cpanic=abort causes abort instead of exit(101) +rm -r tests/run-make/c-unwind-abi-catch-lib-panic +rm -r tests/run-make/c-unwind-abi-catch-panic +rm -r tests/run-make/debug-assertions +rm -r tests/run-make/foreign-double-unwind +rm -r tests/run-make/foreign-exceptions +rm -r tests/run-make/foreign-rust-exceptions +rm -r tests/run-make/libtest-json +rm -r tests/run-make/static-unwinding # requires compiling with -Cpanic=unwind rm -r tests/ui/macros/rfc-2011-nicer-assert-messages/ rm -r tests/run-make/test-benches rm tests/ui/test-attrs/test-type.rs +rm -r tests/run-make/const_fn_mir +rm -r tests/run-make/intrinsic-unreachable # vendor intrinsics rm tests/ui/sse2.rs # cpuid not supported, so sse2 not detected @@ -49,6 +61,7 @@ rm tests/incremental/hashes/statics.rs # same # variadic arguments rm tests/ui/abi/mir/mir_codegen_calls_variadic.rs # requires float varargs rm tests/ui/abi/variadic-ffi.rs # requires callee side vararg support +rm -r tests/run-make/c-link-to-rust-va-list-fn # requires callee side vararg support # unsized locals rm -r tests/run-pass-valgrind/unsized-locals @@ -59,6 +72,19 @@ rm tests/ui/target-feature/missing-plusminus.rs # error not implemented rm tests/ui/fn/dyn-fn-alignment.rs # wants a 256 byte alignment rm -r tests/run-make/emit-named-files # requires full --emit support rm -r tests/run-make/repr128-dwarf # debuginfo test +rm -r tests/run-make/split-debuginfo # same +rm -r tests/run-make/symbols-include-type-name # --emit=asm not supported +rm -r tests/run-make/target-specs # i686 not supported by Cranelift +rm -r tests/run-make/mismatching-target-triples # same +rm -r tests/run-make/use-extern-for-plugins # same + +# requires LTO +rm -r tests/run-make/cdylib +rm -r tests/run-make/issue-14500 +rm -r tests/run-make/issue-64153 +rm -r tests/run-make/codegen-options-parsing +rm -r tests/run-make/lto-* +rm -r tests/run-make/reproducible-build-2 # optimization tests # ================== @@ -70,7 +96,14 @@ rm -r tests/run-make/fmt-write-bloat/ # tests an optimization # backend specific tests # ====================== rm tests/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM +rm -r tests/run-make/cross-lang-lto # same +rm -r tests/run-make/issue-7349 # same +rm -r tests/run-make/sepcomp-inlining # same +rm -r tests/run-make/sepcomp-separate # same +rm -r tests/run-make/sepcomp-cci-copies # same +rm -r tests/run-make/volatile-intrinsics # same rm tests/ui/abi/stack-protector.rs # requires stack protector support +rm -r tests/run-make/emit-stack-sizes # requires support for -Z emit-stack-sizes # giving different but possibly correct results # ============================================= @@ -95,13 +128,12 @@ rm tests/ui/proc-macro/no-missing-docs.rs # same rm tests/ui/rust-2018/proc-macro-crate-in-paths.rs # same rm tests/ui/proc-macro/allowed-signatures.rs # same +# rustdoc-clif passes extra args, suppressing the help message when no args are passed +rm -r tests/run-make/issue-88756-default-output + # doesn't work due to the way the rustc test suite is invoked. # should work when using ./x.py test the way it is intended # ============================================================ -rm -r tests/run-make/emit-shared-files # requires the rustdoc executable in dist/bin/ -rm -r tests/run-make/unstable-flag-required # same -rm -r tests/run-make/rustdoc-* # same -rm -r tests/run-make/issue-88756-default-output # same rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump rm -r tests/ui/consts/missing_span_in_backtrace.rs # expects sysroot source to be elsewhere @@ -112,17 +144,41 @@ rm tests/incremental/spike-neg2.rs # same rm tests/ui/simd/intrinsic/generic-reduction-pass.rs # simd_reduce_add_unordered doesn't accept an accumulator for integer vectors -rm tests/ui/simd/intrinsic/generic-as.rs # crash when accessing vector type field (#1318) rm tests/ui/simd/simd-bitmask.rs # crash +rm -r tests/run-make/issue-51671 # wrong filename given in case of --emit=obj +rm -r tests/run-make/issue-30063 # same +rm -r tests/run-make/multiple-emits # same +rm -r tests/run-make/output-type-permutations # same +rm -r tests/run-make/used # same + # bugs in the test suite # ====================== rm tests/ui/backtrace.rs # TODO warning -rm tests/ui/simple_global_asm.rs # TODO add needs-asm-support rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd +cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist + +# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by +# rustdoc-clif +cat <