From 9150b8ec297483a0b8ff0b8d7c2ef75362c2d5a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A5re=20Alsaker?= Date: Tue, 28 Jan 2020 17:58:44 +0100 Subject: [PATCH] Set lld flavor for MSVC to link.exe --- src/librustc_target/spec/windows_msvc_base.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/librustc_target/spec/windows_msvc_base.rs b/src/librustc_target/spec/windows_msvc_base.rs index 63a443cd07a26..52b166df93996 100644 --- a/src/librustc_target/spec/windows_msvc_base.rs +++ b/src/librustc_target/spec/windows_msvc_base.rs @@ -1,9 +1,11 @@ -use crate::spec::{LinkArgs, LinkerFlavor, TargetOptions}; +use crate::spec::{LinkArgs, LinkerFlavor, LldFlavor, TargetOptions}; use std::default::Default; pub fn opts() -> TargetOptions { + let pre_args = vec!["/NOLOGO".to_string(), "/NXCOMPAT".to_string()]; let mut args = LinkArgs::new(); - args.insert(LinkerFlavor::Msvc, vec!["/NOLOGO".to_string(), "/NXCOMPAT".to_string()]); + args.insert(LinkerFlavor::Msvc, pre_args.clone()); + args.insert(LinkerFlavor::Lld(LldFlavor::Link), pre_args); TargetOptions { function_sections: true, @@ -21,6 +23,7 @@ pub fn opts() -> TargetOptions { // language packs, and avoid generating Non-UTF-8 error // messages if a link error occurred. link_env: vec![("VSLANG".to_string(), "1033".to_string())], + lld_flavor: LldFlavor::Link, pre_link_args: args, crt_static_allows_dylibs: true, crt_static_respected: true,