rewrite c-static-rlib to rmake

This commit is contained in:
Oneirical 2024-07-12 15:16:53 -04:00
parent 1ae1ab8215
commit 1a4fba5eb0
3 changed files with 19 additions and 13 deletions

View File

@ -1,7 +1,6 @@
run-make/branch-protection-check-IBT/Makefile
run-make/c-dynamic-dylib/Makefile
run-make/c-dynamic-rlib/Makefile
run-make/c-static-rlib/Makefile
run-make/c-unwind-abi-catch-lib-panic/Makefile
run-make/c-unwind-abi-catch-panic/Makefile
run-make/cat-and-grep-sanity-check/Makefile

View File

@ -1,12 +0,0 @@
# This test checks that static Rust linking with C does not encounter any errors, with static dependencies given preference over dynamic. (This is the default behaviour.)
# See https://github.com/rust-lang/rust/issues/10434
# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,cfoo)
$(RUSTC) foo.rs
$(RUSTC) bar.rs
$(call REMOVE_RLIBS,foo)
rm $(call NATIVE_STATICLIB,cfoo)
$(call RUN,bar)

View File

@ -0,0 +1,19 @@
// This test checks that static Rust linking with C does not encounter any errors,
// with static dependencies given preference over dynamic. (This is the default behaviour.)
// See https://github.com/rust-lang/rust/issues/10434
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{
build_native_static_lib, fs_wrapper, run, rust_lib_name, rustc, static_lib_name,
};
fn main() {
build_native_static_lib("cfoo");
rustc().input("foo.rs").run();
rustc().input("bar.rs").run();
fs_wrapper::remove_file(rust_lib_name("foo"));
fs_wrapper::remove_file(static_lib_name("cfoo"));
run("bar");
}