Convert run-make/windows-safeseh to rmake
This commit is contained in:
parent
e463f6fd0b
commit
e03f9cb52d
@ -203,6 +203,12 @@ pub fn crate_name<S: AsRef<OsStr>>(&mut self, name: S) -> &mut Self {
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify the linker
|
||||
pub fn linker(&mut self, linker: &str) -> &mut Self {
|
||||
self.cmd.arg(format!("-Clinker={linker}"));
|
||||
self
|
||||
}
|
||||
|
||||
/// Get the [`Output`] of the finished process.
|
||||
#[track_caller]
|
||||
pub fn command_output(&mut self) -> ::std::process::Output {
|
||||
|
@ -1,19 +0,0 @@
|
||||
# only-windows
|
||||
# needs-rust-lld
|
||||
|
||||
include ../tools.mk
|
||||
|
||||
all: foo bar
|
||||
|
||||
# Ensure that LLD can link when an .rlib contains a synthetic object
|
||||
# file referencing exported or used symbols.
|
||||
foo:
|
||||
$(RUSTC) -C linker=rust-lld foo.rs
|
||||
|
||||
# Ensure that LLD can link when /WHOLEARCHIVE: is used with an .rlib.
|
||||
# Previously, lib.rmeta was not marked as (trivially) SAFESEH-aware.
|
||||
bar: baz
|
||||
$(RUSTC) -C linker=rust-lld -C link-arg=/WHOLEARCHIVE:libbaz.rlib bar.rs
|
||||
|
||||
baz:
|
||||
$(RUSTC) baz.rs
|
15
tests/run-make/windows-safeseh/rmake.rs
Normal file
15
tests/run-make/windows-safeseh/rmake.rs
Normal file
@ -0,0 +1,15 @@
|
||||
//@ only-windows
|
||||
//@ needs-rust-lld
|
||||
|
||||
use run_make_support::rustc;
|
||||
|
||||
fn main() {
|
||||
// Ensure that LLD can link when an .rlib contains a synthetic object
|
||||
// file referencing exported or used symbols.
|
||||
rustc().input("foo.rs").linker("rust-lld").run();
|
||||
|
||||
// Ensure that LLD can link when /WHOLEARCHIVE: is used with an .rlib.
|
||||
// Previously, lib.rmeta was not marked as (trivially) SAFESEH-aware.
|
||||
rustc().input("baz.rs").run();
|
||||
rustc().input("bar.rs").linker("rust-lld").link_arg("/WHOLEARCHIVE:libbaz.rlib").run();
|
||||
}
|
Loading…
Reference in New Issue
Block a user