diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index b248b96d8e1..a67474d998f 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -13,7 +13,6 @@ run-make/libtest-json/Makefile run-make/libtest-junit/Makefile run-make/libtest-thread-limit/Makefile run-make/long-linker-command-lines-cmd-exe/Makefile -run-make/long-linker-command-lines/Makefile run-make/macos-deployment-target/Makefile run-make/min-global-align/Makefile run-make/native-link-modifier-bundle/Makefile diff --git a/tests/run-make/long-linker-command-lines/Makefile b/tests/run-make/long-linker-command-lines/Makefile deleted file mode 100644 index b573038e344..00000000000 --- a/tests/run-make/long-linker-command-lines/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -export LD_LIBRARY_PATH := $(HOST_RPATH_DIR) - -all: - $(RUSTC) foo.rs -g -O - RUSTC="$(RUSTC_ORIGINAL)" $(call RUN,foo) diff --git a/tests/run-make/long-linker-command-lines/foo.rs b/tests/run-make/long-linker-command-lines/foo.rs index 9d4a701ad87..4f0ff30e3c0 100644 --- a/tests/run-make/long-linker-command-lines/foo.rs +++ b/tests/run-make/long-linker-command-lines/foo.rs @@ -1,12 +1,3 @@ -// This is a test which attempts to blow out the system limit with how many -// arguments can be passed to a process. This'll successively call rustc with -// larger and larger argument lists in an attempt to find one that's way too -// big for the system at hand. This file itself is then used as a "linker" to -// detect when the process creation succeeds. -// -// Eventually we should see an argument that looks like `@` as we switch from -// passing literal arguments to passing everything in the file. - use std::collections::HashSet; use std::env; use std::fs::{self, File}; @@ -43,8 +34,7 @@ fn read_linker_args(path: &Path) -> String { } fn main() { - let tmpdir = PathBuf::from(env::var_os("TMPDIR").unwrap()); - let ok = tmpdir.join("ok"); + let ok = PathBuf::from("ok"); if env::var("YOU_ARE_A_LINKER").is_ok() { if let Some(file) = env::args_os().find(|a| a.to_string_lossy().contains("@")) { let file = file.to_str().expect("non-utf8 file argument"); @@ -57,7 +47,7 @@ fn main() { let me_as_linker = format!("linker={}", env::current_exe().unwrap().display()); for i in (1..).map(|i| i * 100) { println!("attempt: {}", i); - let file = tmpdir.join("bar.rs"); + let file = PathBuf::from("bar.rs"); let mut expected_libs = write_test_case(&file, i); drop(fs::remove_file(&ok)); @@ -65,8 +55,6 @@ fn main() { .arg(&file) .arg("-C") .arg(&me_as_linker) - .arg("--out-dir") - .arg(&tmpdir) .env("YOU_ARE_A_LINKER", "1") .output() .unwrap(); diff --git a/tests/run-make/long-linker-command-lines/rmake.rs b/tests/run-make/long-linker-command-lines/rmake.rs new file mode 100644 index 00000000000..e832d7f03e2 --- /dev/null +++ b/tests/run-make/long-linker-command-lines/rmake.rs @@ -0,0 +1,19 @@ +// This is a test which attempts to blow out the system limit with how many +// arguments can be passed to a process. This'll successively call rustc with +// larger and larger argument lists in an attempt to find one that's way too +// big for the system at hand. This file itself is then used as a "linker" to +// detect when the process creation succeeds. +// +// Eventually we should see an argument that looks like `@` as we switch from +// passing literal arguments to passing everything in the file. +// See https://github.com/rust-lang/rust/issues/41190 + +//@ ignore-cross-compile +// Reason: the compiled binary is executed + +use run_make_support::{run, rustc}; + +fn main() { + rustc().input("foo.rs").arg("-g").opt().run(); + run("foo"); +}