about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOneirical <manchot@videotron.ca>2024-07-19 15:24:52 -0400
committerOneirical <manchot@videotron.ca>2024-07-25 11:07:06 -0400
commit4dad2a332bfd2dcbd20e99cd70c6cd63f9c92be0 (patch)
tree67574f1276c8947ddeb87f07da655abece96ed88
parent54be9ad5eb47207d155904f6c912a9526133f75f (diff)
downloadrust-4dad2a332bfd2dcbd20e99cd70c6cd63f9c92be0.tar.gz
rust-4dad2a332bfd2dcbd20e99cd70c6cd63f9c92be0.zip
rewrite interdependent-c-libraries to rmake
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/interdependent-c-libraries/Makefile15
-rw-r--r--tests/run-make/interdependent-c-libraries/rmake.rs19
3 files changed, 19 insertions, 16 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index 36f7f68ef7b..dc1b0906278 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -21,7 +21,6 @@ run-make/foreign-exceptions/Makefile
 run-make/foreign-rust-exceptions/Makefile
 run-make/incr-add-rust-src-component/Makefile
 run-make/incr-foreign-head-span/Makefile
-run-make/interdependent-c-libraries/Makefile
 run-make/issue-35164/Makefile
 run-make/issue-36710/Makefile
 run-make/issue-47551/Makefile
diff --git a/tests/run-make/interdependent-c-libraries/Makefile b/tests/run-make/interdependent-c-libraries/Makefile
deleted file mode 100644
index 53a696d82bf..00000000000
--- a/tests/run-make/interdependent-c-libraries/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# ignore-cross-compile
-include ../tools.mk
-
-# The rust crate foo will link to the native library foo, while the rust crate
-# bar will link to the native library bar. There is also a dependency between
-# the native library bar to the natibe library foo.
-#
-# This test ensures that the ordering of -lfoo and -lbar on the command line is
-# correct to complete the linkage. If passed as "-lfoo -lbar", then the 'foo'
-# library will be stripped out, and the linkage will fail.
-
-all: $(call NATIVE_STATICLIB,foo) $(call NATIVE_STATICLIB,bar)
-	$(RUSTC) foo.rs
-	$(RUSTC) bar.rs
-	$(RUSTC) main.rs --print link-args
diff --git a/tests/run-make/interdependent-c-libraries/rmake.rs b/tests/run-make/interdependent-c-libraries/rmake.rs
new file mode 100644
index 00000000000..cd3759d2d71
--- /dev/null
+++ b/tests/run-make/interdependent-c-libraries/rmake.rs
@@ -0,0 +1,19 @@
+// The rust crate foo will link to the native library foo, while the rust crate
+// bar will link to the native library bar. There is also a dependency between
+// the native library bar to the natibe library foo.
+// This test ensures that the ordering of -lfoo and -lbar on the command line is
+// correct to complete the linkage. If passed as "-lfoo -lbar", then the 'foo'
+// library will be stripped out, and the linkage will fail.
+// See https://github.com/rust-lang/rust/commit/e6072fa0c4c22d62acf3dcb78c8ee260a1368bd7
+
+// FIXME(Oneirical): test-various
+
+use run_make_support::{build_native_static_lib, rustc};
+
+fn main() {
+    build_native_static_lib("foo");
+    build_native_static_lib("bar");
+    rustc().input("foo.rs").run();
+    rustc().input("bar.rs").run();
+    rustc().input("main.rs").print("link-args").run();
+}