diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index 31cb32d349a..c527161aa9a 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -142,7 +142,6 @@ run-make/static-dylib-by-default/Makefile run-make/static-extern-type/Makefile run-make/staticlib-blank-lib/Makefile run-make/staticlib-dylib-linkage/Makefile -run-make/std-core-cycle/Makefile run-make/symbol-mangling-hashed/Makefile run-make/symbol-visibility/Makefile run-make/symbols-include-type-name/Makefile diff --git a/tests/run-make/std-core-cycle/Makefile b/tests/run-make/std-core-cycle/Makefile deleted file mode 100644 index 5ed6be905df..00000000000 --- a/tests/run-make/std-core-cycle/Makefile +++ /dev/null @@ -1,17 +0,0 @@ -# ignore-cross-compile -include ../tools.mk - -ifeq ($(UNAME),Darwin) -FLAGS := -else -ifdef IS_WINDOWS -FLAGS := -else -FLAGS := -C link-args=-Wl,--no-undefined -endif -endif - -all: - $(RUSTC) bar.rs - $(RUSTC) foo.rs $(FLAGS) - $(RUSTC) foo.rs $(FLAGS) -C panic=abort diff --git a/tests/run-make/std-core-cycle/rmake.rs b/tests/run-make/std-core-cycle/rmake.rs new file mode 100644 index 00000000000..0f63c3f7ce4 --- /dev/null +++ b/tests/run-make/std-core-cycle/rmake.rs @@ -0,0 +1,28 @@ +// In some cases, linking libraries with GNU used to fail due to how +// `std` and `core` possess a circular dependency with one another, and +// how the linker could not go back through its symbol processing to resolve +// the circular link. #49316 fixed this, and this test reproduces a minimal +// version of one such linking attempt which used to fail. +// See https://github.com/rust-lang/rust/issues/18807 + +//@ ignore-cross-compile + +use run_make_support::{is_darwin, is_windows, rustc}; + +fn main() { + rustc().input("bar.rs").run(); + + let mut rustc_foo = rustc(); + rustc_foo.input("foo.rs"); + let mut rustc_foo_panic = rustc(); + rustc_foo_panic.input("foo.rs").panic("abort"); + + if !is_darwin() && !is_windows() { + rustc_foo.arg("-Clink-args=-Wl,--no-undefined"); + rustc_foo_panic.arg("-Clink-args=-Wl,--no-undefined"); + } + + rustc_foo.run(); + rustc_foo_panic.run(); +} +