From 1e9e4b0a7acce29ab00c3e5cc51dc5fbf650807d Mon Sep 17 00:00:00 2001 From: CrLF0710 Date: Fri, 21 Jun 2019 18:13:41 +0800 Subject: [PATCH 1/3] Add mention of VS 2019 in link error output. --- src/librustc_codegen_ssa/back/link.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs index 0ba5451bd72f5..6789f35ff4934 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs @@ -630,10 +630,14 @@ fn link_natively<'a, B: ArchiveBuilder<'a>>(sess: &'a Session, linker_error.emit(); if sess.target.target.options.is_like_msvc && linker_not_found { - sess.note_without_error("the msvc targets depend on the msvc linker \ - but `link.exe` was not found"); - sess.note_without_error("please ensure that VS 2013, VS 2015 or VS 2017 \ - was installed with the Visual C++ option"); + sess.note_without_error( + "the msvc targets depend on the msvc linker \ + but `link.exe` was not found", + ); + sess.note_without_error( + "please ensure that VS 2013, VS 2015, VS 2017 or VS 2019 \ + was installed with the Visual C++ option", + ); } sess.abort_if_errors(); } From 19f86224a6f0cba0b1563f62a6b43bc888d517db Mon Sep 17 00:00:00 2001 From: CrLF0710 Date: Mon, 24 Jun 2019 19:56:19 +0800 Subject: [PATCH 2/3] Just switch to English linker output using environment variable when using msvc. --- src/librustc_target/spec/windows_msvc_base.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/librustc_target/spec/windows_msvc_base.rs b/src/librustc_target/spec/windows_msvc_base.rs index fdd747cdb865a..db4b6e252c664 100644 --- a/src/librustc_target/spec/windows_msvc_base.rs +++ b/src/librustc_target/spec/windows_msvc_base.rs @@ -19,6 +19,7 @@ pub fn opts() -> TargetOptions { target_family: Some("windows".to_string()), is_like_windows: true, is_like_msvc: true, + link_env: vec![("VSLANG".to_string(), "1033".to_string())], pre_link_args: args, crt_static_allows_dylibs: true, crt_static_respected: true, From 8339211809987bcdc4a627214f03e4479182bfc2 Mon Sep 17 00:00:00 2001 From: CrLF0710 Date: Thu, 27 Jun 2019 20:59:17 +0800 Subject: [PATCH 3/3] Added comment description. --- src/librustc_target/spec/windows_msvc_base.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustc_target/spec/windows_msvc_base.rs b/src/librustc_target/spec/windows_msvc_base.rs index db4b6e252c664..b139083e99fc1 100644 --- a/src/librustc_target/spec/windows_msvc_base.rs +++ b/src/librustc_target/spec/windows_msvc_base.rs @@ -19,6 +19,9 @@ pub fn opts() -> TargetOptions { target_family: Some("windows".to_string()), is_like_windows: true, is_like_msvc: true, + // set VSLANG to 1033 can prevent link.exe from using + // language packs, and avoid generating Non-UTF-8 error + // messages if a link error occurred. link_env: vec![("VSLANG".to_string(), "1033".to_string())], pre_link_args: args, crt_static_allows_dylibs: true,