about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-18 13:04:45 -0400
committerOneirical <manchot@videotron.ca>2024-08-02 10:06:07 -0400
commit5b44f800f37e0d3093aa5b89c10eb401bbc600eb (patch)
treed3ec10296f157a07ba11b01a2c20bc54545badae
parent8f641b1b953e04eefc0cede84af169088ebc1401 (diff)
downloadrust-5b44f800f37e0d3093aa5b89c10eb401bbc600eb.tar.gz
rust-5b44f800f37e0d3093aa5b89c10eb401bbc600eb.zip
rewrite and rename issue-36710 to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/cpp-global-destructors/foo.cpp (renamed from tests/run-make/issue-36710/foo.cpp)0
-rw-r--r--tests/run-make/cpp-global-destructors/foo.rs (renamed from tests/run-make/issue-36710/foo.rs)0
-rw-r--r--tests/run-make/cpp-global-destructors/rmake.rs27
-rw-r--r--tests/run-make/issue-36710/Makefile19
5 files changed, 27 insertions, 20 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index d0824d97306..2d5f7b9ae9e 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -11,7 +11,6 @@ run-make/emit-to-stdout/Makefile
 run-make/extern-fn-reachable/Makefile
 run-make/foreign-exceptions/Makefile
 run-make/incr-add-rust-src-component/Makefile
-run-make/issue-36710/Makefile
 run-make/issue-84395-lto-embed-bitcode/Makefile
 run-make/issue-88756-default-output/Makefile
 run-make/jobserver-error/Makefile
diff --git a/tests/run-make/issue-36710/foo.cpp b/tests/run-make/cpp-global-destructors/foo.cpp
index 8f878c2c272..8f878c2c272 100644
--- a/tests/run-make/issue-36710/foo.cpp
+++ b/tests/run-make/cpp-global-destructors/foo.cpp
diff --git a/tests/run-make/issue-36710/foo.rs b/tests/run-make/cpp-global-destructors/foo.rs
index f30a35e27c0..f30a35e27c0 100644
--- a/tests/run-make/issue-36710/foo.rs
+++ b/tests/run-make/cpp-global-destructors/foo.rs
diff --git a/tests/run-make/cpp-global-destructors/rmake.rs b/tests/run-make/cpp-global-destructors/rmake.rs
new file mode 100644
index 00000000000..02928b9de9d
--- /dev/null
+++ b/tests/run-make/cpp-global-destructors/rmake.rs
@@ -0,0 +1,27 @@
+// Some start files were missed when originally writing the logic to swap in musl start files.
+// This caused #36710. After the fix in #50105, this test checks that linking to C++ code
+// with global destructors works.
+// See https://github.com/rust-lang/rust/pull/50105
+
+//@ ignore-cross-compile
+// Reason: the compiled binary is executed
+
+// FIXME(Oneirical): are these really necessary? This test is supposed to test a musl
+// bug... and it ignores musl? This wasn't part of the original test at its creation, which
+// had no ignores.
+
+//# ignore-none no-std is not supported
+//# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
+//# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
+//# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
+//# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
+//#                    (see dist-i586-gnu-i586-i686-musl Dockerfile)
+//# ignore-sgx
+
+use run_make_support::{build_native_static_lib_cxx, run, rustc};
+
+fn main() {
+    build_native_static_lib_cxx("foo");
+    rustc().input("foo.rs").arg("-lfoo").extra_rs_cxx_flags().run();
+    run("foo");
+}
diff --git a/tests/run-make/issue-36710/Makefile b/tests/run-make/issue-36710/Makefile
deleted file mode 100644
index 7b91107a234..00000000000
--- a/tests/run-make/issue-36710/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# ignore-cross-compile
-# ignore-none no-std is not supported
-# ignore-wasm32 FIXME: don't attempt to compile C++ to WASM
-# ignore-wasm64 FIXME: don't attempt to compile C++ to WASM
-# ignore-nvptx64-nvidia-cuda FIXME: can't find crate for `std`
-# ignore-musl FIXME: this makefile needs teaching how to use a musl toolchain
-#                    (see dist-i586-gnu-i586-i686-musl Dockerfile)
-# ignore-sgx
-
-include ../tools.mk
-
-all: foo
-	$(call RUN,foo)
-
-foo: foo.rs $(call NATIVE_STATICLIB,foo)
-	$(RUSTC) $< -lfoo $(EXTRARSCXXFLAGS) --target $(TARGET)
-
-$(TMPDIR)/libfoo.o: foo.cpp
-	$(call COMPILE_OBJ_CXX,$@,$<)