about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/Makefile16
-rw-r--r--tests/run-make/c-link-to-rust-staticlib/rmake.rs15
3 files changed, 15 insertions, 17 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index c2358eff617..be18d9b3931 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -8,7 +8,6 @@ run-make/branch-protection-check-IBT/Makefile
 run-make/c-dynamic-dylib/Makefile
 run-make/c-dynamic-rlib/Makefile
 run-make/c-link-to-rust-dylib/Makefile
-run-make/c-link-to-rust-staticlib/Makefile
 run-make/c-static-dylib/Makefile
 run-make/c-static-rlib/Makefile
 run-make/c-unwind-abi-catch-lib-panic/Makefile
diff --git a/tests/run-make/c-link-to-rust-staticlib/Makefile b/tests/run-make/c-link-to-rust-staticlib/Makefile
deleted file mode 100644
index d36cc421c46..00000000000
--- a/tests/run-make/c-link-to-rust-staticlib/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# This test checks that C linking with Rust does not encounter any errors, with static libraries.
-# See https://github.com/rust-lang/rust/issues/10434
-
-# ignore-cross-compile
-include ../tools.mk
-
-# ignore-freebsd
-# FIXME
-
-all:
-	$(RUSTC) foo.rs
-	$(CC) bar.c $(call STATICLIB,foo) $(call OUT_EXE,bar) \
-		$(EXTRACFLAGS) $(EXTRACXXFLAGS)
-	$(call RUN,bar)
-	rm $(call STATICLIB,foo)
-	$(call RUN,bar)
diff --git a/tests/run-make/c-link-to-rust-staticlib/rmake.rs b/tests/run-make/c-link-to-rust-staticlib/rmake.rs
new file mode 100644
index 00000000000..63d5eb78c69
--- /dev/null
+++ b/tests/run-make/c-link-to-rust-staticlib/rmake.rs
@@ -0,0 +1,15 @@
+// This test checks that C linking with Rust does not encounter any errors, with a static library.
+// See https://github.com/rust-lang/rust/issues/10434
+
+//@ ignore-cross-compile
+
+use run_make_support::{cc, extra_c_flags, run, rustc, static_lib};
+use std::fs;
+
+fn main() {
+    rustc().input("foo.rs").run();
+    cc().input("bar.c").input(static_lib("foo")).out_exe("bar").args(&extra_c_flags()).run();
+    run("bar");
+    fs::remove_file(static_lib("foo"));
+    run("bar");
+}