Migrate wasm-override-linker to rmake

This commit is contained in:
Jerry Wang 2024-06-23 16:41:36 -04:00
parent 56fe015d4a
commit 189232bc42
3 changed files with 17 additions and 17 deletions

View File

@ -187,5 +187,4 @@ run-make/translation/Makefile
run-make/type-mismatch-same-crate-name/Makefile
run-make/unstable-flag-required/Makefile
run-make/wasm-exceptions-nostd/Makefile
run-make/wasm-override-linker/Makefile
run-make/x86_64-fortanix-unknown-sgx-lvi/Makefile

View File

@ -1,16 +0,0 @@
# needs-force-clang-based-tests
# FIXME(#126180): This test doesn't actually run anywhere, because the only
# CI job that sets RUSTBUILD_FORCE_CLANG_BASED_TESTS runs very few tests.
include ../tools.mk
ifeq ($(TARGET),wasm32-unknown-unknown)
all:
$(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
else ifeq ($(TARGET),wasm64-unknown-unknown)
all:
$(RUSTC) foo.rs --crate-type cdylib --target $(TARGET) -C linker=$(CLANG)
else
all:
endif

View File

@ -0,0 +1,17 @@
// How to run this
// $ RUSTBUILD_FORCE_CLANG_BASED_TESTS=1 ./x.py test tests/run-make/wasm-override-linker/
//@ needs-force-clang-based-tests
use run_make_support::{env_var, rustc, target};
fn main() {
if matches!(target().as_str(), "wasm32-unknown-unknown" | "wasm64-unknown-unknown") {
rustc()
.input("foo.rs")
.crate_type("cdylib")
.target(&target())
.linker(&env_var("CLANG"))
.run();
}
}