rewrite interdependent-c-libraries to rmake

This commit is contained in:
Oneirical 2024-07-19 15:24:52 -04:00
parent 54be9ad5eb
commit 4dad2a332b
3 changed files with 19 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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();
}