about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJieyou Xu <jieyouxu@outlook.com>2025-06-16 20:24:50 +0800
committerJieyou Xu <jieyouxu@outlook.com>2025-06-19 07:38:01 +0800
commit2beccc4d8e5066a42e6623d91e7991870d36feb2 (patch)
tree3a52ca4ec12a9f1324dd1764b574a74a5108c832
parent49be6f32588e2eb276e9210b64f4927f609bbe96 (diff)
downloadrust-2beccc4d8e5066a42e6623d91e7991870d36feb2.tar.gz
rust-2beccc4d8e5066a42e6623d91e7991870d36feb2.zip
Adjust some run-make tests on cross-compile
-rw-r--r--tests/run-make/allow-warnings-cmdline-stability/rmake.rs2
-rw-r--r--tests/run-make/crate-circular-deps-link/rmake.rs4
-rw-r--r--tests/run-make/doctests-merge/rmake.rs3
-rw-r--r--tests/run-make/doctests-runtool/rmake.rs4
-rw-r--r--tests/run-make/embed-metadata/rmake.rs5
-rw-r--r--tests/run-make/embed-source-dwarf/rmake.rs2
-rw-r--r--tests/run-make/emit-shared-files/rmake.rs2
-rw-r--r--tests/run-make/emit-stack-sizes/rmake.rs3
-rw-r--r--tests/run-make/env-dep-info/rmake.rs6
-rw-r--r--tests/run-make/exit-code/rmake.rs4
-rw-r--r--tests/run-make/export-executable-symbols/rmake.rs5
-rw-r--r--tests/run-make/export/disambiguator/rmake.rs6
-rw-r--r--tests/run-make/export/extern-opt/rmake.rs6
-rw-r--r--tests/run-make/export/simple/rmake.rs6
-rw-r--r--tests/run-make/extern-diff-internal-name/rmake.rs4
-rw-r--r--tests/run-make/extern-flag-fun/rmake.rs2
-rw-r--r--tests/run-make/extern-multiple-copies/rmake.rs4
-rw-r--r--tests/run-make/extern-multiple-copies2/rmake.rs4
-rw-r--r--tests/run-make/ice-dep-cannot-find-dep/rmake.rs1
-rw-r--r--tests/run-make/include-all-symbols-linking/rmake.rs4
-rw-r--r--tests/run-make/incr-prev-body-beyond-eof/rmake.rs2
-rw-r--r--tests/run-make/incr-test-moved-file/rmake.rs2
-rw-r--r--tests/run-make/intrinsic-unreachable/rmake.rs1
-rw-r--r--tests/run-make/invalid-so/rmake.rs4
-rw-r--r--tests/run-make/issue-125484-used-dependencies/rmake.rs4
-rw-r--r--tests/run-make/json-error-no-offset/rmake.rs4
-rw-r--r--tests/run-make/link-args-order/rmake.rs3
-rw-r--r--tests/run-make/link-dedup/rmake.rs10
-rw-r--r--tests/run-make/linker-warning/rmake.rs3
-rw-r--r--tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs2
-rw-r--r--tests/run-make/naked-symbol-visibility/rmake.rs3
-rw-r--r--tests/run-make/native-lib-alt-naming/rmake.rs6
-rw-r--r--tests/run-make/native-link-modifier-verbatim-linker/rmake.rs3
-rw-r--r--tests/run-make/no-builtins-attribute/filecheck.main.txt4
-rw-r--r--tests/run-make/no-builtins-attribute/rmake.rs2
-rw-r--r--tests/run-make/no-builtins-lto/rmake.rs4
-rw-r--r--tests/run-make/non-unicode-in-incremental-dir/rmake.rs2
-rw-r--r--tests/run-make/proc-macro-three-crates/rmake.rs6
-rw-r--r--tests/run-make/relro-levels/rmake.rs1
-rw-r--r--tests/run-make/repr128-dwarf/rmake.rs3
-rw-r--r--tests/run-make/reproducible-build-2/rmake.rs2
-rw-r--r--tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs4
-rw-r--r--tests/run-make/rustc-macro-dep-files/rmake.rs6
-rw-r--r--tests/run-make/rustdoc-default-output/rmake.rs4
-rw-r--r--tests/run-make/rustdoc-dep-info/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-determinism/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-error-lines/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-io-error/rmake.rs1
-rw-r--r--tests/run-make/rustdoc-map-file/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-output-path/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-output-stdout/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-test-args/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-themes/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-verify-output-files/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-with-out-dir-option/rmake.rs2
-rw-r--r--tests/run-make/rustdoc-with-output-option/rmake.rs2
-rw-r--r--tests/run-make/share-generics-dylib/rmake.rs6
-rw-r--r--tests/run-make/staticlib-thin-archive/rmake.rs4
-rw-r--r--tests/run-make/stdin-rustc/rmake.rs10
-rw-r--r--tests/run-make/stdin-rustdoc/rmake.rs2
-rw-r--r--tests/run-make/symbol-visibility/rmake.rs6
-rw-r--r--tests/run-make/track-path-dep-info/rmake.rs6
-rw-r--r--tests/run-make/used/rmake.rs3
63 files changed, 143 insertions, 79 deletions
diff --git a/tests/run-make/allow-warnings-cmdline-stability/rmake.rs b/tests/run-make/allow-warnings-cmdline-stability/rmake.rs
index 66ca3eb3383..033a06741e2 100644
--- a/tests/run-make/allow-warnings-cmdline-stability/rmake.rs
+++ b/tests/run-make/allow-warnings-cmdline-stability/rmake.rs
@@ -1,4 +1,4 @@
-//@ needs-target-std
+//@ ignore-cross-compile
 // Test that `-Awarnings` suppresses warnings for unstable APIs.
 
 use run_make_support::rustc;
diff --git a/tests/run-make/crate-circular-deps-link/rmake.rs b/tests/run-make/crate-circular-deps-link/rmake.rs
index 6771fdec7e8..38b922c328f 100644
--- a/tests/run-make/crate-circular-deps-link/rmake.rs
+++ b/tests/run-make/crate-circular-deps-link/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // Test that previously triggered a linker failure with root cause
 // similar to one found in the issue #69368.
 //
diff --git a/tests/run-make/doctests-merge/rmake.rs b/tests/run-make/doctests-merge/rmake.rs
index 8236997d72d..7893d4988eb 100644
--- a/tests/run-make/doctests-merge/rmake.rs
+++ b/tests/run-make/doctests-merge/rmake.rs
@@ -1,4 +1,5 @@
-//@ needs-target-std
+//@ ignore-cross-compile (needs to run doctests)
+
 use std::path::Path;
 
 use run_make_support::{cwd, diff, rustc, rustdoc};
diff --git a/tests/run-make/doctests-runtool/rmake.rs b/tests/run-make/doctests-runtool/rmake.rs
index aaba4174910..bc406630932 100644
--- a/tests/run-make/doctests-runtool/rmake.rs
+++ b/tests/run-make/doctests-runtool/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile (needs to run host tool binary)
+
 // Tests behavior of rustdoc `--test-runtool`.
 
 use std::path::PathBuf;
diff --git a/tests/run-make/embed-metadata/rmake.rs b/tests/run-make/embed-metadata/rmake.rs
index a41716d1542..2de6575feb8 100644
--- a/tests/run-make/embed-metadata/rmake.rs
+++ b/tests/run-make/embed-metadata/rmake.rs
@@ -1,5 +1,6 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: dylib
+
 // Tests the -Zembed-metadata compiler flag.
 // Tracking issue: https://github.com/rust-lang/rust/issues/139165
 
diff --git a/tests/run-make/embed-source-dwarf/rmake.rs b/tests/run-make/embed-source-dwarf/rmake.rs
index 99fad359054..f57e6aba13e 100644
--- a/tests/run-make/embed-source-dwarf/rmake.rs
+++ b/tests/run-make/embed-source-dwarf/rmake.rs
@@ -1,6 +1,8 @@
 //@ needs-target-std
 //@ ignore-windows
 //@ ignore-apple
+//@ ignore-wasm (`object` doesn't handle wasm object files)
+//@ ignore-cross-compile
 
 // This test should be replaced with one in tests/debuginfo once we can easily
 // tell via GDB or LLDB if debuginfo contains source code. Cheap tricks in LLDB
diff --git a/tests/run-make/emit-shared-files/rmake.rs b/tests/run-make/emit-shared-files/rmake.rs
index c8c113ce944..f88fe69aa9c 100644
--- a/tests/run-make/emit-shared-files/rmake.rs
+++ b/tests/run-make/emit-shared-files/rmake.rs
@@ -5,6 +5,8 @@
 // `all-shared` should only emit files that can be shared between crates.
 // See https://github.com/rust-lang/rust/pull/83478
 
+//@ needs-target-std
+
 use run_make_support::{has_extension, has_prefix, path, rustdoc, shallow_find_files};
 
 fn main() {
diff --git a/tests/run-make/emit-stack-sizes/rmake.rs b/tests/run-make/emit-stack-sizes/rmake.rs
index 886e875cfae..2e7f40896a5 100644
--- a/tests/run-make/emit-stack-sizes/rmake.rs
+++ b/tests/run-make/emit-stack-sizes/rmake.rs
@@ -7,8 +7,7 @@
 // See https://github.com/rust-lang/rust/pull/51946
 
 //@ needs-target-std
-//@ ignore-windows
-//@ ignore-apple
+//@ only-elf
 // Reason: this feature only works when the output object format is ELF.
 // This won't be the case on Windows/OSX - for example, OSX produces a Mach-O binary.
 
diff --git a/tests/run-make/env-dep-info/rmake.rs b/tests/run-make/env-dep-info/rmake.rs
index 97006a63205..18e6250d7d4 100644
--- a/tests/run-make/env-dep-info/rmake.rs
+++ b/tests/run-make/env-dep-info/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: proc-macro
+//@ ignore-musl (FIXME: can't find `-lunwind`)
+
 // Inside dep-info emit files, #71858 made it so all accessed environment
 // variables are usefully printed. This test checks that this feature works
 // as intended by checking if the environment variables used in compilation
diff --git a/tests/run-make/exit-code/rmake.rs b/tests/run-make/exit-code/rmake.rs
index 5fdf920b55a..21dea06a55a 100644
--- a/tests/run-make/exit-code/rmake.rs
+++ b/tests/run-make/exit-code/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
 
 use run_make_support::{rustc, rustdoc};
diff --git a/tests/run-make/export-executable-symbols/rmake.rs b/tests/run-make/export-executable-symbols/rmake.rs
index dc8c59b9c74..884c7362822 100644
--- a/tests/run-make/export-executable-symbols/rmake.rs
+++ b/tests/run-make/export-executable-symbols/rmake.rs
@@ -8,9 +8,8 @@
 // Reason: the export-executable-symbols flag only works on Unix
 // due to hardcoded platform-specific implementation
 // (See #85673)
-//@ ignore-wasm32
-//@ ignore-wasm64
-//@ needs-target-std
+//@ ignore-cross-compile
+//@ ignore-wasm
 
 use run_make_support::{bin_name, llvm_readobj, rustc};
 
diff --git a/tests/run-make/export/disambiguator/rmake.rs b/tests/run-make/export/disambiguator/rmake.rs
index f855e42d08e..afbe7f2cdbc 100644
--- a/tests/run-make/export/disambiguator/rmake.rs
+++ b/tests/run-make/export/disambiguator/rmake.rs
@@ -1,4 +1,8 @@
-//@ needs-target-std
+//@ ignore-cross-compile
+
+// NOTE: `sdylib`'s platform support is basically just `dylib`'s platform support.
+//@ needs-crate-type: dylib
+
 use run_make_support::rustc;
 
 fn main() {
diff --git a/tests/run-make/export/extern-opt/rmake.rs b/tests/run-make/export/extern-opt/rmake.rs
index a2f9ba28c2f..2e3a70b251c 100644
--- a/tests/run-make/export/extern-opt/rmake.rs
+++ b/tests/run-make/export/extern-opt/rmake.rs
@@ -1,4 +1,8 @@
-//@ needs-target-std
+//@ ignore-cross-compile
+
+// NOTE: `sdylib`'s platform support is basically that of `dylib`.
+//@ needs-crate-type: dylib
+
 use run_make_support::{dynamic_lib_name, rustc};
 
 fn main() {
diff --git a/tests/run-make/export/simple/rmake.rs b/tests/run-make/export/simple/rmake.rs
index f855e42d08e..6468e38c69b 100644
--- a/tests/run-make/export/simple/rmake.rs
+++ b/tests/run-make/export/simple/rmake.rs
@@ -1,4 +1,8 @@
-//@ needs-target-std
+//@ ignore-cross-compile
+
+// NOTE: `sdylib`'s platform support is basically that of `dylib`.
+//@ needs-crate-type: dylib
+
 use run_make_support::rustc;
 
 fn main() {
diff --git a/tests/run-make/extern-diff-internal-name/rmake.rs b/tests/run-make/extern-diff-internal-name/rmake.rs
index 1bae8decb05..c905de1d9a8 100644
--- a/tests/run-make/extern-diff-internal-name/rmake.rs
+++ b/tests/run-make/extern-diff-internal-name/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // In the following scenario:
 // 1. The crate foo, is referenced multiple times
 // 2. --extern foo=./path/to/libbar.rlib is specified to rustc
diff --git a/tests/run-make/extern-flag-fun/rmake.rs b/tests/run-make/extern-flag-fun/rmake.rs
index 181a76b7cfa..0b5e3c245c5 100644
--- a/tests/run-make/extern-flag-fun/rmake.rs
+++ b/tests/run-make/extern-flag-fun/rmake.rs
@@ -1,4 +1,4 @@
-//@ needs-target-std
+//@ ignore-cross-compile
 //
 // The --extern flag can override the default crate search of
 // the compiler and directly fetch a given path. There are a few rules
diff --git a/tests/run-make/extern-multiple-copies/rmake.rs b/tests/run-make/extern-multiple-copies/rmake.rs
index d9d769d178c..01e4beed1b5 100644
--- a/tests/run-make/extern-multiple-copies/rmake.rs
+++ b/tests/run-make/extern-multiple-copies/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // In this test, the rust library foo1 exists in two different locations, but only one
 // is required by the --extern flag. This test checks that the copy is ignored (as --extern
 // demands fetching only the original instance of foo1) and that no error is emitted, resulting
diff --git a/tests/run-make/extern-multiple-copies2/rmake.rs b/tests/run-make/extern-multiple-copies2/rmake.rs
index 4188d5bdc18..5937929a1f3 100644
--- a/tests/run-make/extern-multiple-copies2/rmake.rs
+++ b/tests/run-make/extern-multiple-copies2/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // Almost identical to `extern-multiple-copies`, but with a variation in the --extern calls
 // and the addition of #[macro_use] in the rust code files, which used to break --extern
 // until #33625.
diff --git a/tests/run-make/ice-dep-cannot-find-dep/rmake.rs b/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
index 1c136773f01..cb3cf39e436 100644
--- a/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
+++ b/tests/run-make/ice-dep-cannot-find-dep/rmake.rs
@@ -9,6 +9,7 @@
 
 //@ only-x86_64
 //@ only-linux
+//@ ignore-cross-compile
 // Reason: This is a platform-independent issue, no need to waste time testing
 // everywhere.
 
diff --git a/tests/run-make/include-all-symbols-linking/rmake.rs b/tests/run-make/include-all-symbols-linking/rmake.rs
index 4f85ee179f5..61b83e7a07f 100644
--- a/tests/run-make/include-all-symbols-linking/rmake.rs
+++ b/tests/run-make/include-all-symbols-linking/rmake.rs
@@ -7,7 +7,9 @@
 // See https://github.com/rust-lang/rust/pull/95604
 // See https://github.com/rust-lang/rust/issues/47384
 
-//@ needs-target-std
+//@ ignore-cross-compile
+//@ needs-crate-type: cdylib
+//@ needs-dynamic-linking
 //@ ignore-wasm differences in object file formats causes errors in the llvm_objdump step.
 //@ ignore-windows differences in object file formats causes errors in the llvm_objdump step.
 
diff --git a/tests/run-make/incr-prev-body-beyond-eof/rmake.rs b/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
index cfa8d5b46cd..cdecf127a2c 100644
--- a/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
+++ b/tests/run-make/incr-prev-body-beyond-eof/rmake.rs
@@ -7,7 +7,7 @@
 // was hashed by rustc in addition to the span length, and the fix still
 // works.
 
-//@ needs-target-std
+//@ ignore-cross-compile
 
 use run_make_support::{rfs, rustc};
 
diff --git a/tests/run-make/incr-test-moved-file/rmake.rs b/tests/run-make/incr-test-moved-file/rmake.rs
index dfba95d3fed..9a00a14ae95 100644
--- a/tests/run-make/incr-test-moved-file/rmake.rs
+++ b/tests/run-make/incr-test-moved-file/rmake.rs
@@ -9,7 +9,7 @@
 // for successful compilation.
 // See https://github.com/rust-lang/rust/issues/83112
 
-//@ needs-target-std
+//@ ignore-cross-compile
 
 use run_make_support::{rfs, rustc};
 
diff --git a/tests/run-make/intrinsic-unreachable/rmake.rs b/tests/run-make/intrinsic-unreachable/rmake.rs
index bb189fbdcb5..ea9c0a1434a 100644
--- a/tests/run-make/intrinsic-unreachable/rmake.rs
+++ b/tests/run-make/intrinsic-unreachable/rmake.rs
@@ -4,6 +4,7 @@
 // which means the emitted artifacts should be shorter in length.
 // See https://github.com/rust-lang/rust/pull/16970
 
+//@ needs-target-std
 //@ needs-asm-support
 //@ ignore-windows
 // Reason: Because of Windows exception handling, the code is not necessarily any shorter.
diff --git a/tests/run-make/invalid-so/rmake.rs b/tests/run-make/invalid-so/rmake.rs
index ee886b5ee3a..9e5ce583ece 100644
--- a/tests/run-make/invalid-so/rmake.rs
+++ b/tests/run-make/invalid-so/rmake.rs
@@ -1,5 +1,7 @@
 //@ needs-target-std
-//
+//@ needs-crate-type: dylib
+//@ needs-dynamic-linking
+
 // When a fake library was given to the compiler, it would
 // result in an obscure and unhelpful error message. This test
 // creates a false "foo" dylib, and checks that the standard error
diff --git a/tests/run-make/issue-125484-used-dependencies/rmake.rs b/tests/run-make/issue-125484-used-dependencies/rmake.rs
index afcea34783f..67b0b600b47 100644
--- a/tests/run-make/issue-125484-used-dependencies/rmake.rs
+++ b/tests/run-make/issue-125484-used-dependencies/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // Non-regression test for issues #125474, #125484, #125646, with the repro taken from #125484. Some
 // queries use "used dependencies" while others use "speculatively loaded dependencies", and an
 // indexing ICE appeared in some cases when these were unexpectedly used in the same context.
diff --git a/tests/run-make/json-error-no-offset/rmake.rs b/tests/run-make/json-error-no-offset/rmake.rs
index 3f45778ca04..296d968540a 100644
--- a/tests/run-make/json-error-no-offset/rmake.rs
+++ b/tests/run-make/json-error-no-offset/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // The byte positions in json format error logging used to have a small, difficult
 // to predict offset. This was changed to be the top of the file every time in #42973,
 // and this test checks that the measurements appearing in the standard error are correct.
diff --git a/tests/run-make/link-args-order/rmake.rs b/tests/run-make/link-args-order/rmake.rs
index a4591ea3949..7a67c12f74c 100644
--- a/tests/run-make/link-args-order/rmake.rs
+++ b/tests/run-make/link-args-order/rmake.rs
@@ -1,5 +1,6 @@
 //@ needs-target-std
-//
+//@ ignore-wasm (explicit linker invocations)
+
 // Passing linker arguments to the compiler used to be lost or reordered in a messy way
 // as they were passed further to the linker. This was fixed in #70665, and this test
 // checks that linker arguments remain intact and in the order they were originally passed in.
diff --git a/tests/run-make/link-dedup/rmake.rs b/tests/run-make/link-dedup/rmake.rs
index 0148817f987..874e6e0083b 100644
--- a/tests/run-make/link-dedup/rmake.rs
+++ b/tests/run-make/link-dedup/rmake.rs
@@ -1,5 +1,5 @@
 //@ needs-target-std
-//
+//@ ignore-musl (not passed consecutively)
 // When native libraries are passed to the linker, there used to be an annoyance
 // where multiple instances of the same library in a row would cause duplication in
 // outputs. This has been fixed, and this test checks that it stays fixed.
@@ -9,7 +9,7 @@
 
 use std::fmt::Write;
 
-use run_make_support::{is_msvc, rustc};
+use run_make_support::{is_msvc, rustc, target};
 
 fn main() {
     rustc().input("depa.rs").run();
@@ -33,9 +33,11 @@ fn needle_from_libs(libs: &[&str]) -> String {
     let mut needle = String::new();
     for lib in libs {
         if is_msvc() {
-            let _ = needle.write_fmt(format_args!(r#""{lib}.lib" "#));
+            needle.write_fmt(format_args!(r#""{lib}.lib" "#)).unwrap();
+        } else if target().contains("wasm") {
+            needle.write_fmt(format_args!(r#""-l" "{lib}" "#)).unwrap();
         } else {
-            let _ = needle.write_fmt(format_args!(r#""-l{lib}" "#));
+            needle.write_fmt(format_args!(r#""-l{lib}" "#)).unwrap();
         }
     }
     needle.pop(); // remove trailing space
diff --git a/tests/run-make/linker-warning/rmake.rs b/tests/run-make/linker-warning/rmake.rs
index eb1bbbff8ef..344b880faab 100644
--- a/tests/run-make/linker-warning/rmake.rs
+++ b/tests/run-make/linker-warning/rmake.rs
@@ -1,4 +1,5 @@
-//@ needs-target-std
+//@ ignore-cross-compile (need to run fake linker)
+
 use run_make_support::{Rustc, diff, regex, rustc};
 
 fn run_rustc() -> Rustc {
diff --git a/tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs b/tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs
index 0d96b40e8a4..70a0853848c 100644
--- a/tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs
+++ b/tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs
@@ -12,7 +12,7 @@
 // sessions.
 // See https://github.com/rust-lang/rust/issues/85019
 
-//@ needs-target-std
+//@ ignore-cross-compile
 
 use run_make_support::{rfs, rust_lib_name, rustc};
 
diff --git a/tests/run-make/naked-symbol-visibility/rmake.rs b/tests/run-make/naked-symbol-visibility/rmake.rs
index c69a9ef9eeb..d73eafcaefe 100644
--- a/tests/run-make/naked-symbol-visibility/rmake.rs
+++ b/tests/run-make/naked-symbol-visibility/rmake.rs
@@ -1,5 +1,8 @@
 //@ ignore-windows
 //@ only-x86_64
+//@ needs-target-std
+//@ needs-crate-type: dylib
+
 use run_make_support::object::ObjectSymbol;
 use run_make_support::object::read::{File, Object, Symbol};
 use run_make_support::targets::is_windows;
diff --git a/tests/run-make/native-lib-alt-naming/rmake.rs b/tests/run-make/native-lib-alt-naming/rmake.rs
index a1dc002533f..e989cece603 100644
--- a/tests/run-make/native-lib-alt-naming/rmake.rs
+++ b/tests/run-make/native-lib-alt-naming/rmake.rs
@@ -1,10 +1,8 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // On MSVC the alternative naming format for static libraries (`libfoo.a`) is accepted in addition
 // to the default format (`foo.lib`).
 
-//REMOVE@ only-msvc
-
 use run_make_support::rustc;
 
 fn main() {
diff --git a/tests/run-make/native-link-modifier-verbatim-linker/rmake.rs b/tests/run-make/native-link-modifier-verbatim-linker/rmake.rs
index e06be13d9b9..4fb0690531a 100644
--- a/tests/run-make/native-link-modifier-verbatim-linker/rmake.rs
+++ b/tests/run-make/native-link-modifier-verbatim-linker/rmake.rs
@@ -3,8 +3,9 @@
 // This test is the same as native-link-modifier-rustc, but without rlibs.
 // See https://github.com/rust-lang/rust/issues/99425
 
-//@ needs-target-std
+//@ ignore-cross-compile
 //@ ignore-apple
+//@ ignore-wasm
 // Reason: linking fails due to the unusual ".ext" staticlib name.
 
 use run_make_support::rustc;
diff --git a/tests/run-make/no-builtins-attribute/filecheck.main.txt b/tests/run-make/no-builtins-attribute/filecheck.main.txt
index ecd650bdca8..7cbe94f5728 100644
--- a/tests/run-make/no-builtins-attribute/filecheck.main.txt
+++ b/tests/run-make/no-builtins-attribute/filecheck.main.txt
@@ -1,5 +1,5 @@
-CHECK: declare void @foo()
+CHECK: declare{{.*}} void @foo()
 CHECK-SAME: #[[ATTR_3:[0-9]+]]
 
-CHECK: attributes #[[ATTR_3]] 
+CHECK: attributes #[[ATTR_3]]
 CHECK-SAME: no-builtins
diff --git a/tests/run-make/no-builtins-attribute/rmake.rs b/tests/run-make/no-builtins-attribute/rmake.rs
index 038958f19ed..f08316e14ce 100644
--- a/tests/run-make/no-builtins-attribute/rmake.rs
+++ b/tests/run-make/no-builtins-attribute/rmake.rs
@@ -1,5 +1,4 @@
 //@ needs-target-std
-//
 // `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
 // effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
 // This test uses the `llvm-filecheck` tool to determine that this attribute is successfully
@@ -11,5 +10,6 @@ use run_make_support::{llvm_filecheck, rfs, rustc};
 fn main() {
     rustc().input("no_builtins.rs").emit("link").run();
     rustc().input("main.rs").emit("llvm-ir").run();
+
     llvm_filecheck().patterns("filecheck.main.txt").stdin_buf(rfs::read("main.ll")).run();
 }
diff --git a/tests/run-make/no-builtins-lto/rmake.rs b/tests/run-make/no-builtins-lto/rmake.rs
index a1d9dc43e71..c7c075f1a66 100644
--- a/tests/run-make/no-builtins-lto/rmake.rs
+++ b/tests/run-make/no-builtins-lto/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // The rlib produced by a no_builtins crate should be explicitly linked
 // during compilation, and as a result be present in the linker arguments.
 // See the comments inside this file for more details.
diff --git a/tests/run-make/non-unicode-in-incremental-dir/rmake.rs b/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
index 5c437a3fe00..aa6b83cf062 100644
--- a/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
+++ b/tests/run-make/non-unicode-in-incremental-dir/rmake.rs
@@ -1,4 +1,4 @@
-//@ needs-target-std
+//@ ignore-cross-compile
 use run_make_support::{rfs, rustc};
 
 fn main() {
diff --git a/tests/run-make/proc-macro-three-crates/rmake.rs b/tests/run-make/proc-macro-three-crates/rmake.rs
index e5a3385acbc..4dfc32fe7e4 100644
--- a/tests/run-make/proc-macro-three-crates/rmake.rs
+++ b/tests/run-make/proc-macro-three-crates/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: proc-macro
+//@ ignore-musl (FIXME: can't find `-lunwind`)
+
 // A compiler bug caused the following issue:
 // If a crate A depends on crate B, and crate B
 // depends on crate C, and crate C contains a procedural
diff --git a/tests/run-make/relro-levels/rmake.rs b/tests/run-make/relro-levels/rmake.rs
index 91d106a03e4..67aa7c155ea 100644
--- a/tests/run-make/relro-levels/rmake.rs
+++ b/tests/run-make/relro-levels/rmake.rs
@@ -1,6 +1,7 @@
 // This tests the different -Crelro-level values, and makes sure that they work properly.
 
 //@ only-linux
+//@ ignore-cross-compile
 
 use run_make_support::{llvm_readobj, rustc};
 
diff --git a/tests/run-make/repr128-dwarf/rmake.rs b/tests/run-make/repr128-dwarf/rmake.rs
index 1372d2bcc46..96c65d7d897 100644
--- a/tests/run-make/repr128-dwarf/rmake.rs
+++ b/tests/run-make/repr128-dwarf/rmake.rs
@@ -1,4 +1,5 @@
-//@ needs-target-std
+//@ ignore-cross-compile
+//@ ignore-wasm (`object` can't handle wasm object files)
 //@ ignore-windows
 // This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
 
diff --git a/tests/run-make/reproducible-build-2/rmake.rs b/tests/run-make/reproducible-build-2/rmake.rs
index 0e1781dbfbe..5971fa01f92 100644
--- a/tests/run-make/reproducible-build-2/rmake.rs
+++ b/tests/run-make/reproducible-build-2/rmake.rs
@@ -6,7 +6,7 @@
 // Outputs should be identical.
 // See https://github.com/rust-lang/rust/issues/34902
 
-//@ needs-target-std
+//@ ignore-cross-compile
 //@ ignore-windows
 // Reasons:
 // 1. The object files are reproducible, but their paths are not, which causes
diff --git a/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs b/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs
index 70d1ead85b5..50c3f7f6df1 100644
--- a/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs
+++ b/tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // `-Z packed_bundled_libs` is an unstable rustc flag that makes the compiler
 // only require a native library and no supplementary object files to compile.
 // This test simply checks that this flag can be passed alongside verbatim syntax
diff --git a/tests/run-make/rustc-macro-dep-files/rmake.rs b/tests/run-make/rustc-macro-dep-files/rmake.rs
index c01244824bb..2eb490e5d23 100644
--- a/tests/run-make/rustc-macro-dep-files/rmake.rs
+++ b/tests/run-make/rustc-macro-dep-files/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: proc-macro
+//@ ignore-musl (FIXME: can't find `-lunwind`)
+
 // --emit dep-info used to print all macro-generated code it could
 // find as if it was part of a nonexistent file named "proc-macro source",
 // which is not a valid path. After this was fixed in #36776, this test checks
diff --git a/tests/run-make/rustdoc-default-output/rmake.rs b/tests/run-make/rustdoc-default-output/rmake.rs
index 5f9c501e528..06720445a35 100644
--- a/tests/run-make/rustdoc-default-output/rmake.rs
+++ b/tests/run-make/rustdoc-default-output/rmake.rs
@@ -3,10 +3,10 @@
 // ensures the output of rustdoc's help menu is as expected.
 // See https://github.com/rust-lang/rust/issues/88756
 
-use run_make_support::{diff, rustdoc};
+use run_make_support::{bare_rustdoc, diff};
 
 fn main() {
-    let out = rustdoc().run().stdout_utf8();
+    let out = bare_rustdoc().run().stdout_utf8();
     diff()
         .expected_file("output-default.stdout")
         .actual_text("actual", out)
diff --git a/tests/run-make/rustdoc-dep-info/rmake.rs b/tests/run-make/rustdoc-dep-info/rmake.rs
index 6902bfc21ca..db7a00a5ce2 100644
--- a/tests/run-make/rustdoc-dep-info/rmake.rs
+++ b/tests/run-make/rustdoc-dep-info/rmake.rs
@@ -1,6 +1,8 @@
 // This is a simple smoke test for rustdoc's `--emit dep-info` feature. It prints out
 // information about dependencies in a Makefile-compatible format, as a `.d` file.
 
+//@ needs-target-std
+
 use run_make_support::assertion_helpers::assert_contains;
 use run_make_support::{path, rfs, rustdoc};
 
diff --git a/tests/run-make/rustdoc-determinism/rmake.rs b/tests/run-make/rustdoc-determinism/rmake.rs
index 5a030c6f496..921baef4a97 100644
--- a/tests/run-make/rustdoc-determinism/rmake.rs
+++ b/tests/run-make/rustdoc-determinism/rmake.rs
@@ -1,6 +1,8 @@
 // Assert that the search index is generated deterministically, regardless of the
 // order that crates are documented in.
 
+//@ needs-target-std
+
 use run_make_support::{diff, path, rustdoc};
 
 fn main() {
diff --git a/tests/run-make/rustdoc-error-lines/rmake.rs b/tests/run-make/rustdoc-error-lines/rmake.rs
index 0d8c500ed1e..e15d91e9387 100644
--- a/tests/run-make/rustdoc-error-lines/rmake.rs
+++ b/tests/run-make/rustdoc-error-lines/rmake.rs
@@ -1,6 +1,8 @@
 // Assert that the search index is generated deterministically, regardless of the
 // order that crates are documented in.
 
+//@ needs-target-std
+
 use run_make_support::rustdoc;
 
 fn main() {
diff --git a/tests/run-make/rustdoc-io-error/rmake.rs b/tests/run-make/rustdoc-io-error/rmake.rs
index 31441d7ebc5..766091abf97 100644
--- a/tests/run-make/rustdoc-io-error/rmake.rs
+++ b/tests/run-make/rustdoc-io-error/rmake.rs
@@ -13,6 +13,7 @@
 // containers would use a non-root user, but this leads to issues with
 // `mkfs.ext4 -d`, as well as mounting a loop device for the rootfs.
 //@ ignore-windows - the `set_readonly` functions doesn't work on folders.
+//@ needs-target-std
 
 use run_make_support::{path, rfs, rustdoc};
 
diff --git a/tests/run-make/rustdoc-map-file/rmake.rs b/tests/run-make/rustdoc-map-file/rmake.rs
index 50dcc603c02..802c924d580 100644
--- a/tests/run-make/rustdoc-map-file/rmake.rs
+++ b/tests/run-make/rustdoc-map-file/rmake.rs
@@ -1,6 +1,8 @@
 // This test ensures that all items from `foo` are correctly generated into the `redirect-map.json`
 // file with `--generate-redirect-map` rustdoc option.
 
+//@ needs-target-std
+
 use run_make_support::rfs::read_to_string;
 use run_make_support::{path, rustdoc, serde_json};
 
diff --git a/tests/run-make/rustdoc-output-path/rmake.rs b/tests/run-make/rustdoc-output-path/rmake.rs
index 7f6accf26c2..cece914e947 100644
--- a/tests/run-make/rustdoc-output-path/rmake.rs
+++ b/tests/run-make/rustdoc-output-path/rmake.rs
@@ -1,5 +1,7 @@
 // Checks that if the output folder doesn't exist, rustdoc will create it.
 
+//@ needs-target-std
+
 use run_make_support::{path, rustdoc};
 
 fn main() {
diff --git a/tests/run-make/rustdoc-output-stdout/rmake.rs b/tests/run-make/rustdoc-output-stdout/rmake.rs
index d2fd0451163..e6c007978bd 100644
--- a/tests/run-make/rustdoc-output-stdout/rmake.rs
+++ b/tests/run-make/rustdoc-output-stdout/rmake.rs
@@ -1,6 +1,8 @@
 // This test verifies that rustdoc `-o -` prints JSON on stdout and doesn't generate
 // a JSON file.
 
+//@ needs-target-std
+
 use run_make_support::path_helpers::{cwd, has_extension, read_dir_entries_recursive};
 use run_make_support::{rustdoc, serde_json};
 
diff --git a/tests/run-make/rustdoc-test-args/rmake.rs b/tests/run-make/rustdoc-test-args/rmake.rs
index fddb3795402..7c0223cf732 100644
--- a/tests/run-make/rustdoc-test-args/rmake.rs
+++ b/tests/run-make/rustdoc-test-args/rmake.rs
@@ -1,3 +1,5 @@
+//@ ignore-cross-compile (needs to run doctest binary)
+
 use std::iter;
 use std::path::Path;
 
diff --git a/tests/run-make/rustdoc-themes/rmake.rs b/tests/run-make/rustdoc-themes/rmake.rs
index 4577e47d47e..681e6baaee3 100644
--- a/tests/run-make/rustdoc-themes/rmake.rs
+++ b/tests/run-make/rustdoc-themes/rmake.rs
@@ -1,5 +1,7 @@
 // Test that rustdoc will properly load in a theme file and display it in the theme selector.
 
+//@ needs-target-std
+
 use std::path::Path;
 
 use run_make_support::{htmldocck, rfs, rustdoc, source_root};
diff --git a/tests/run-make/rustdoc-verify-output-files/rmake.rs b/tests/run-make/rustdoc-verify-output-files/rmake.rs
index a4d4050b745..181d321997b 100644
--- a/tests/run-make/rustdoc-verify-output-files/rmake.rs
+++ b/tests/run-make/rustdoc-verify-output-files/rmake.rs
@@ -1,3 +1,5 @@
+//@ needs-target-std
+
 use std::path::{Path, PathBuf};
 
 use run_make_support::{assert_dirs_are_equal, rfs, rustdoc};
diff --git a/tests/run-make/rustdoc-with-out-dir-option/rmake.rs b/tests/run-make/rustdoc-with-out-dir-option/rmake.rs
index a82a1965a9c..231a5b36600 100644
--- a/tests/run-make/rustdoc-with-out-dir-option/rmake.rs
+++ b/tests/run-make/rustdoc-with-out-dir-option/rmake.rs
@@ -1,3 +1,5 @@
+//@ needs-target-std
+
 use run_make_support::{htmldocck, rustdoc};
 
 fn main() {
diff --git a/tests/run-make/rustdoc-with-output-option/rmake.rs b/tests/run-make/rustdoc-with-output-option/rmake.rs
index f7fbbec6986..2c1b76f5b9c 100644
--- a/tests/run-make/rustdoc-with-output-option/rmake.rs
+++ b/tests/run-make/rustdoc-with-output-option/rmake.rs
@@ -1,3 +1,5 @@
+//@ needs-target-std
+
 use run_make_support::{htmldocck, rustdoc};
 
 fn main() {
diff --git a/tests/run-make/share-generics-dylib/rmake.rs b/tests/run-make/share-generics-dylib/rmake.rs
index 2d52cd43db7..ae9e51abffd 100644
--- a/tests/run-make/share-generics-dylib/rmake.rs
+++ b/tests/run-make/share-generics-dylib/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-dynamic-linking
+//@ needs-crate-type: dylib
+
 // This test makes sure all generic instances get re-exported from Rust dylibs for use by
 // `-Zshare-generics`. There are two rlibs (`instance_provider_a` and `instance_provider_b`)
 // which both provide an instance of `Cell<i32>::set`. There is `instance_user_dylib` which is
diff --git a/tests/run-make/staticlib-thin-archive/rmake.rs b/tests/run-make/staticlib-thin-archive/rmake.rs
index 1fb56ac0538..5281e9f8c9c 100644
--- a/tests/run-make/staticlib-thin-archive/rmake.rs
+++ b/tests/run-make/staticlib-thin-archive/rmake.rs
@@ -1,5 +1,5 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+
 // Regression test for https://github.com/rust-lang/rust/issues/107407 which
 // checks that rustc can read thin archive. Before the object crate added thin
 // archive support rustc would add emit object files to the staticlib and after
diff --git a/tests/run-make/stdin-rustc/rmake.rs b/tests/run-make/stdin-rustc/rmake.rs
index 318d569a760..6ae33766b90 100644
--- a/tests/run-make/stdin-rustc/rmake.rs
+++ b/tests/run-make/stdin-rustc/rmake.rs
@@ -1,9 +1,9 @@
-//@ needs-target-std
+//@ ignore-cross-compile
 //! This test checks rustc `-` (stdin) support
 
 use std::path::PathBuf;
 
-use run_make_support::{is_windows, rustc};
+use run_make_support::{bin_name, rustc};
 
 const HELLO_WORLD: &str = r#"
 fn main() {
@@ -16,11 +16,7 @@ const NOT_UTF8: &[u8] = &[0xff, 0xff, 0xff];
 fn main() {
     // echo $HELLO_WORLD | rustc -
     rustc().arg("-").stdin_buf(HELLO_WORLD).run();
-    assert!(
-        PathBuf::from(if !is_windows() { "rust_out" } else { "rust_out.exe" })
-            .try_exists()
-            .unwrap()
-    );
+    assert!(PathBuf::from(bin_name("rust_out")).try_exists().unwrap());
 
     // echo $NOT_UTF8 | rustc -
     rustc().arg("-").stdin_buf(NOT_UTF8).run_fail().assert_stderr_contains(
diff --git a/tests/run-make/stdin-rustdoc/rmake.rs b/tests/run-make/stdin-rustdoc/rmake.rs
index 30f97b8a2cd..0420eac1993 100644
--- a/tests/run-make/stdin-rustdoc/rmake.rs
+++ b/tests/run-make/stdin-rustdoc/rmake.rs
@@ -1,3 +1,5 @@
+//@ ignore-cross-compile (needs to run doctests)
+
 //! This test checks rustdoc `-` (stdin) handling
 
 use std::path::PathBuf;
diff --git a/tests/run-make/symbol-visibility/rmake.rs b/tests/run-make/symbol-visibility/rmake.rs
index 0175158d08b..49c8e87707b 100644
--- a/tests/run-make/symbol-visibility/rmake.rs
+++ b/tests/run-make/symbol-visibility/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: dylib, cdylib, proc-macro
+//@ needs-dynamic-linking
+
 // Dynamic libraries on Rust used to export a very high amount of symbols,
 // going as far as filling the output with mangled names and generic function
 // names. After the rework of #38117, this test checks that no mangled Rust symbols
diff --git a/tests/run-make/track-path-dep-info/rmake.rs b/tests/run-make/track-path-dep-info/rmake.rs
index 4b98a1b48d5..955c46f7e68 100644
--- a/tests/run-make/track-path-dep-info/rmake.rs
+++ b/tests/run-make/track-path-dep-info/rmake.rs
@@ -1,5 +1,7 @@
-//@ needs-target-std
-//
+//@ ignore-cross-compile
+//@ needs-crate-type: proc-macro
+//@ ignore-musl (FIXME: can't find `-lunwind`)
+
 // This test checks the functionality of `tracked_path::path`, a procedural macro
 // feature that adds a dependency to another file inside the procmacro. In this case,
 // the text file is added through this method, and the test checks that the compilation
diff --git a/tests/run-make/used/rmake.rs b/tests/run-make/used/rmake.rs
index daed69c1b38..bcdb84132d3 100644
--- a/tests/run-make/used/rmake.rs
+++ b/tests/run-make/used/rmake.rs
@@ -1,5 +1,6 @@
 //@ needs-target-std
-//
+//@ ignore-wasm (`object` can't handle wasm object files)
+
 // This test ensures that the compiler is keeping static variables, even if not referenced
 // by another part of the program, in the output object file.
 //