rewrite manual-link to rmake

This commit is contained in:
Oneirical 2024-07-16 15:07:10 -04:00
parent 06dcdbb2ee
commit aeca91e08d
3 changed files with 16 additions and 8 deletions

View File

@ -72,7 +72,6 @@ run-make/lto-linkage-used-attr/Makefile
run-make/lto-no-link-whole-rlib/Makefile run-make/lto-no-link-whole-rlib/Makefile
run-make/lto-smoke-c/Makefile run-make/lto-smoke-c/Makefile
run-make/macos-deployment-target/Makefile run-make/macos-deployment-target/Makefile
run-make/manual-link/Makefile
run-make/min-global-align/Makefile run-make/min-global-align/Makefile
run-make/missing-crate-dependency/Makefile run-make/missing-crate-dependency/Makefile
run-make/native-link-modifier-bundle/Makefile run-make/native-link-modifier-bundle/Makefile

View File

@ -1,7 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: $(TMPDIR)/libbar.a
$(RUSTC) foo.rs -lstatic=bar
$(RUSTC) main.rs
$(call RUN,main)

View File

@ -0,0 +1,16 @@
// A smoke test for the `-l` command line rustc flag, which manually links to the selected
// library. Useful for native libraries, this is roughly equivalent to `#[link]` in Rust code.
// If compilation succeeds, the flag successfully linked the native library.
// See https://github.com/rust-lang/rust/pull/18470
//@ ignore-cross-compile
// Reason: the compiled binary is executed
use run_make_support::{build_native_static_lib, run, rustc};
fn main() {
build_native_static_lib("bar");
rustc().input("foo.rs").arg("-lstatic=bar").run();
rustc().input("main.rs").run();
run("main");
}