From 8acfe9a1380f73fade8dfe35aa054b3b6870faee Mon Sep 17 00:00:00 2001 From: Rémy Rakic Date: Mon, 15 Apr 2024 18:08:55 +0000 Subject: add `link_arg` helper to `run_make_support` and use it in the `rust-lld` tests --- src/tools/run-make-support/src/rustc.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/tools/run-make-support/src/rustc.rs b/src/tools/run-make-support/src/rustc.rs index ebda151b908..88e409a588a 100644 --- a/src/tools/run-make-support/src/rustc.rs +++ b/src/tools/run-make-support/src/rustc.rs @@ -149,6 +149,12 @@ impl Rustc { self } + /// Add an extra argument to the linker invocation, via `-Clink-arg`. + pub fn link_arg(&mut self, link_arg: &str) -> &mut Self { + self.cmd.arg(format!("-Clink-arg={link_arg}")); + self + } + #[track_caller] pub fn run_fail_assert_exit_code(&mut self, code: i32) -> Output { let caller_location = std::panic::Location::caller(); -- cgit 1.4.1-3-g733a5