Rollup merge of #125886 - GuillaumeGomez:migrate-run-make-issue-15460, r=jieyouxu

Migrate run make issue 15460

Part of https://github.com/rust-lang/rust/issues/121876.

r? `@jieyouxu`

try-job: x86_64-msvc
try-job: aarch64-apple
try-job: x86_64-gnu-llvm-18
This commit is contained in:
Matthias Krüger 2024-07-23 19:42:34 +02:00 committed by GitHub
commit 9d4daf8869
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 16 additions and 8 deletions

View File

@ -3378,6 +3378,7 @@ fn run_rmake_legacy_test(&self) {
cmd.env("IS_MSVC", "1")
.env("IS_WINDOWS", "1")
.env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
.env("MSVC_LIB_PATH", format!("{}", lib.display()))
.env("CC", format!("'{}' {}", self.config.cc, cflags))
.env("CXX", format!("'{}' {}", &self.config.cxx, cxxflags));
} else {
@ -3748,6 +3749,7 @@ fn run_rmake_v2_test(&self) {
cmd.env("IS_MSVC", "1")
.env("IS_WINDOWS", "1")
.env("MSVC_LIB", format!("'{}' -nologo", lib.display()))
.env("MSVC_LIB_PATH", format!("{}", lib.display()))
// Note: we diverge from legacy run_make and don't lump `CC` the compiler and
// default flags together.
.env("CC_DEFAULT_FLAGS", &cflags)

View File

@ -27,7 +27,6 @@ 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-15460/Makefile
run-make/issue-35164/Makefile
run-make/issue-36710/Makefile
run-make/issue-47551/Makefile

View File

@ -1,7 +0,0 @@
# ignore-cross-compile
include ../tools.mk
all: $(call NATIVE_STATICLIB,foo)
$(RUSTC) foo.rs -C extra-filename=-383hf8 -C prefer-dynamic
$(RUSTC) bar.rs
$(call RUN,bar)

View File

@ -0,0 +1,14 @@
// Regression test for <https://github.com/rust-lang/rust/issues/15460>.
//@ ignore-cross-compile
use run_make_support::{build_native_static_lib, run, rustc};
fn main() {
build_native_static_lib("foo");
rustc().input("foo.rs").extra_filename("-383hf8").arg("-Cprefer-dynamic").run();
rustc().input("bar.rs").run();
run("bar");
}