Skip to content

Commit 5b1a099

Browse files
committed
Adjust some run-make tests on cross-compile
1 parent fd0e0b3 commit 5b1a099

File tree

64 files changed

+144
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+144
-83
lines changed

tests/run-make/allow-warnings-cmdline-stability/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
22
// Test that `-Awarnings` suppresses warnings for unstable APIs.
33

44
use run_make_support::rustc;

tests/run-make/crate-circular-deps-link/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// Test that previously triggered a linker failure with root cause
44
// similar to one found in the issue #69368.
55
//

tests/run-make/doctests-merge/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile (needs to run doctests)
2+
23
use std::path::Path;
34

45
use run_make_support::{cwd, diff, rustc, rustdoc};

tests/run-make/doctests-runtool/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile (needs to run host tool binary)
2+
33
// Tests behavior of rustdoc `--test-runtool`.
44

55
use std::path::PathBuf;

tests/run-make/embed-metadata/rmake.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
//@ needs-crate-type: dylib
3+
34
// Tests the -Zembed-metadata compiler flag.
45
// Tracking issue: https://github.com/rust-lang/rust/issues/139165
56

tests/run-make/embed-source-dwarf/rmake.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
//@ needs-target-std
22
//@ ignore-windows
33
//@ ignore-apple
4+
//@ ignore-wasm (`object` doesn't handle wasm object files)
5+
//@ ignore-cross-compile
46

57
// This test should be replaced with one in tests/debuginfo once we can easily
68
// tell via GDB or LLDB if debuginfo contains source code. Cheap tricks in LLDB

tests/run-make/emit-shared-files/rmake.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
// `all-shared` should only emit files that can be shared between crates.
66
// See https://github.com/rust-lang/rust/pull/83478
77

8+
//@ needs-target-std
9+
810
use run_make_support::{has_extension, has_prefix, path, rustdoc, shallow_find_files};
911

1012
fn main() {

tests/run-make/emit-stack-sizes/rmake.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
// See https://github.com/rust-lang/rust/pull/51946
88

99
//@ needs-target-std
10-
//@ ignore-windows
11-
//@ ignore-apple
10+
//@ only-elf
1211
// Reason: this feature only works when the output object format is ELF.
1312
// This won't be the case on Windows/OSX - for example, OSX produces a Mach-O binary.
1413

tests/run-make/env-dep-info/rmake.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
//@ needs-crate-type: proc-macro
3+
//@ ignore-musl (FIXME: can't find `-lunwind`)
4+
35
// Inside dep-info emit files, #71858 made it so all accessed environment
46
// variables are usefully printed. This test checks that this feature works
57
// as intended by checking if the environment variables used in compilation

tests/run-make/exit-code/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// Test that we exit with the correct exit code for successful / unsuccessful / ICE compilations
44

55
use run_make_support::{rustc, rustdoc};

tests/run-make/export-executable-symbols/rmake.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,8 @@
88
// Reason: the export-executable-symbols flag only works on Unix
99
// due to hardcoded platform-specific implementation
1010
// (See #85673)
11-
//@ ignore-wasm32
12-
//@ ignore-wasm64
13-
//@ needs-target-std
11+
//@ ignore-cross-compile
12+
//@ ignore-wasm
1413

1514
use run_make_support::{bin_name, llvm_readobj, rustc};
1615

tests/run-make/export/disambiguator/rmake.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
2+
3+
// NOTE: `sdylib`'s platform support is basically just `dylib`'s platform support.
4+
//@ needs-crate-type: dylib
5+
26
use run_make_support::rustc;
37

48
fn main() {

tests/run-make/export/extern-opt/rmake.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
2+
3+
// NOTE: `sdylib`'s platform support is basically that of `dylib`.
4+
//@ needs-crate-type: dylib
5+
26
use run_make_support::{dynamic_lib_name, rustc};
37

48
fn main() {

tests/run-make/export/simple/rmake.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
2+
3+
// NOTE: `sdylib`'s platform support is basically that of `dylib`.
4+
//@ needs-crate-type: dylib
5+
26
use run_make_support::rustc;
37

48
fn main() {

tests/run-make/extern-diff-internal-name/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// In the following scenario:
44
// 1. The crate foo, is referenced multiple times
55
// 2. --extern foo=./path/to/libbar.rlib is specified to rustc

tests/run-make/extern-flag-fun/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
22
//
33
// The --extern flag can override the default crate search of
44
// the compiler and directly fetch a given path. There are a few rules

tests/run-make/extern-multiple-copies/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// In this test, the rust library foo1 exists in two different locations, but only one
44
// is required by the --extern flag. This test checks that the copy is ignored (as --extern
55
// demands fetching only the original instance of foo1) and that no error is emitted, resulting

tests/run-make/extern-multiple-copies2/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// Almost identical to `extern-multiple-copies`, but with a variation in the --extern calls
44
// and the addition of #[macro_use] in the rust code files, which used to break --extern
55
// until #33625.

tests/run-make/ice-dep-cannot-find-dep/rmake.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
//@ only-x86_64
1111
//@ only-linux
12+
//@ ignore-cross-compile
1213
// Reason: This is a platform-independent issue, no need to waste time testing
1314
// everywhere.
1415

tests/run-make/include-all-symbols-linking/rmake.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
// See https://github.com/rust-lang/rust/pull/95604
88
// See https://github.com/rust-lang/rust/issues/47384
99

10-
//@ needs-target-std
10+
//@ ignore-cross-compile
11+
//@ needs-crate-type: cdylib
12+
//@ needs-dynamic-linking
1113
//@ ignore-wasm differences in object file formats causes errors in the llvm_objdump step.
1214
//@ ignore-windows differences in object file formats causes errors in the llvm_objdump step.
1315

tests/run-make/incr-prev-body-beyond-eof/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// was hashed by rustc in addition to the span length, and the fix still
88
// works.
99

10-
//@ needs-target-std
10+
//@ ignore-cross-compile
1111

1212
use run_make_support::{rfs, rustc};
1313

tests/run-make/incr-test-moved-file/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// for successful compilation.
1010
// See https://github.com/rust-lang/rust/issues/83112
1111

12-
//@ needs-target-std
12+
//@ ignore-cross-compile
1313

1414
use run_make_support::{rfs, rustc};
1515

tests/run-make/invalid-so/rmake.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
//@ needs-target-std
2-
//
2+
//@ needs-crate-type: dylib
3+
//@ needs-dynamic-linking
4+
35
// When a fake library was given to the compiler, it would
46
// result in an obscure and unhelpful error message. This test
57
// creates a false "foo" dylib, and checks that the standard error

tests/run-make/issue-125484-used-dependencies/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// Non-regression test for issues #125474, #125484, #125646, with the repro taken from #125484. Some
44
// queries use "used dependencies" while others use "speculatively loaded dependencies", and an
55
// indexing ICE appeared in some cases when these were unexpectedly used in the same context.

tests/run-make/json-error-no-offset/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// The byte positions in json format error logging used to have a small, difficult
44
// to predict offset. This was changed to be the top of the file every time in #42973,
55
// and this test checks that the measurements appearing in the standard error are correct.

tests/run-make/link-args-order/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//@ needs-target-std
2-
//
2+
//@ ignore-wasm (explicit linker invocations)
3+
34
// Passing linker arguments to the compiler used to be lost or reordered in a messy way
45
// as they were passed further to the linker. This was fixed in #70665, and this test
56
// checks that linker arguments remain intact and in the order they were originally passed in.

tests/run-make/link-dedup/rmake.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ needs-target-std
2-
//
2+
//@ ignore-musl (not passed consecutively)
33
// When native libraries are passed to the linker, there used to be an annoyance
44
// where multiple instances of the same library in a row would cause duplication in
55
// outputs. This has been fixed, and this test checks that it stays fixed.
@@ -9,7 +9,7 @@
99

1010
use std::fmt::Write;
1111

12-
use run_make_support::{is_msvc, rustc};
12+
use run_make_support::{is_msvc, rustc, target};
1313

1414
fn main() {
1515
rustc().input("depa.rs").run();
@@ -33,9 +33,11 @@ fn needle_from_libs(libs: &[&str]) -> String {
3333
let mut needle = String::new();
3434
for lib in libs {
3535
if is_msvc() {
36-
let _ = needle.write_fmt(format_args!(r#""{lib}.lib" "#));
36+
needle.write_fmt(format_args!(r#""{lib}.lib" "#)).unwrap();
37+
} else if target().contains("wasm") {
38+
needle.write_fmt(format_args!(r#""-l" "{lib}" "#)).unwrap();
3739
} else {
38-
let _ = needle.write_fmt(format_args!(r#""-l{lib}" "#));
40+
needle.write_fmt(format_args!(r#""-l{lib}" "#)).unwrap();
3941
}
4042
}
4143
needle.pop(); // remove trailing space

tests/run-make/linker-warning/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile (need to run fake linker)
2+
23
use run_make_support::{Rustc, diff, regex, rustc};
34

45
fn run_rustc() -> Rustc {

tests/run-make/moved-src-dir-fingerprint-ice/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// sessions.
1313
// See https://github.com/rust-lang/rust/issues/85019
1414

15-
//@ needs-target-std
15+
//@ ignore-cross-compile
1616

1717
use run_make_support::{rfs, rust_lib_name, rustc};
1818

tests/run-make/naked-symbol-visibility/rmake.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//@ ignore-windows
22
//@ only-x86_64
3+
//@ needs-target-std
4+
//@ needs-crate-type: dylib
5+
36
use run_make_support::object::ObjectSymbol;
47
use run_make_support::object::read::{File, Object, Symbol};
58
use run_make_support::targets::is_windows;

tests/run-make/native-lib-alt-naming/rmake.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// On MSVC the alternative naming format for static libraries (`libfoo.a`) is accepted in addition
44
// to the default format (`foo.lib`).
55

6-
//REMOVE@ only-msvc
7-
86
use run_make_support::rustc;
97

108
fn main() {

tests/run-make/native-link-modifier-verbatim-linker/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
// This test is the same as native-link-modifier-rustc, but without rlibs.
44
// See https://github.com/rust-lang/rust/issues/99425
55

6-
//@ needs-target-std
6+
//@ ignore-cross-compile
77
//@ ignore-apple
8+
//@ ignore-wasm
89
// Reason: linking fails due to the unusual ".ext" staticlib name.
910

1011
use run_make_support::rustc;
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
CHECK: declare void @foo()
1+
CHECK: declare{{.*}} void @foo()
22
CHECK-SAME: #[[ATTR_3:[0-9]+]]
33

4-
CHECK: attributes #[[ATTR_3]]
4+
CHECK: attributes #[[ATTR_3]]
55
CHECK-SAME: no-builtins

tests/run-make/no-builtins-attribute/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//@ needs-target-std
2-
//
32
// `no_builtins` is an attribute related to LLVM's optimizations. In order to ensure that it has an
43
// effect on link-time optimizations (LTO), it should be added to function declarations in a crate.
54
// 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};
1110
fn main() {
1211
rustc().input("no_builtins.rs").emit("link").run();
1312
rustc().input("main.rs").emit("llvm-ir").run();
13+
1414
llvm_filecheck().patterns("filecheck.main.txt").stdin_buf(rfs::read("main.ll")).run();
1515
}

tests/run-make/no-builtins-lto/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// The rlib produced by a no_builtins crate should be explicitly linked
44
// during compilation, and as a result be present in the linker arguments.
55
// See the comments inside this file for more details.

tests/run-make/non-unicode-in-incremental-dir/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
22
use run_make_support::{rfs, rustc};
33

44
fn main() {

tests/run-make/proc-macro-three-crates/rmake.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
//@ needs-crate-type: proc-macro
3+
//@ ignore-musl (FIXME: can't find `-lunwind`)
4+
35
// A compiler bug caused the following issue:
46
// If a crate A depends on crate B, and crate B
57
// depends on crate C, and crate C contains a procedural

tests/run-make/relro-levels/rmake.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// This tests the different -Crelro-level values, and makes sure that they work properly.
22

33
//@ only-linux
4+
//@ ignore-cross-compile
45

56
use run_make_support::{llvm_readobj, rustc};
67

tests/run-make/repr128-dwarf/rmake.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
//@ needs-target-std
1+
//@ ignore-cross-compile
2+
//@ ignore-wasm (`object` can't handle wasm object files)
23
//@ ignore-windows
34
// This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit enums.
45

tests/run-make/reproducible-build-2/rmake.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Outputs should be identical.
77
// See https://github.com/rust-lang/rust/issues/34902
88

9-
//@ needs-target-std
9+
//@ ignore-cross-compile
1010
//@ ignore-windows
1111
// Reasons:
1212
// 1. The object files are reproducible, but their paths are not, which causes

tests/run-make/rlib-format-packed-bundled-libs-2/rmake.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
33
// `-Z packed_bundled_libs` is an unstable rustc flag that makes the compiler
44
// only require a native library and no supplementary object files to compile.
55
// This test simply checks that this flag can be passed alongside verbatim syntax

tests/run-make/rustc-macro-dep-files/rmake.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
//@ needs-target-std
2-
//
1+
//@ ignore-cross-compile
2+
//@ needs-crate-type: proc-macro
3+
//@ ignore-musl (FIXME: can't find `-lunwind`)
4+
35
// --emit dep-info used to print all macro-generated code it could
46
// find as if it was part of a nonexistent file named "proc-macro source",
57
// which is not a valid path. After this was fixed in #36776, this test checks

0 commit comments

Comments
 (0)