Convert run-make/windows-safeseh to rmake
This commit is contained in:
parent
e463f6fd0b
commit
e03f9cb52d
3 changed files with 21 additions and 19 deletions
|
@ -203,6 +203,12 @@ impl Rustc {
|
||||||
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.
|
/// Get the [`Output`] of the finished process.
|
||||||
#[track_caller]
|
#[track_caller]
|
||||||
pub fn command_output(&mut self) -> ::std::process::Output {
|
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…
Add table
Add a link
Reference in a new issue