From c1e91e497ffbe1d795c3bb996f0a6c2e42fd5018 Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Sat, 8 Nov 2025 12:18:02 +0100 Subject: rust: call compilers.get_base_link_args The rustc invocation performs both compilation and linking, so it should include link-phase arguments for LTO or sanitizers. RustCompiler has been taught how to include these arguments, so now add them. Signed-off-by: Paolo Bonzini --- mesonbuild/compilers/rust.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py index a32499ce8..73c38148b 100644 --- a/mesonbuild/compilers/rust.py +++ b/mesonbuild/compilers/rust.py @@ -329,6 +329,9 @@ class RustCompiler(Compiler): def get_crt_link_args(self, crt_val: str, buildtype: str) -> T.List[str]: if not isinstance(self.linker, VisualStudioLikeLinkerMixin): return [] + # Rustc always use non-debug Windows runtime. Inject the one selected + # by Meson options instead. + # https://github.com/rust-lang/rust/issues/39016 return self.MSVCRT_ARGS[self.get_crt_val(crt_val, buildtype)] def get_colorout_args(self, colortype: str) -> T.List[str]: -- cgit v1.2.3