diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-07-03 09:59:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-03 09:59:10 -0400 |
| commit | 7d5d59160a5e1f535ddfebb6cee22839cd253673 (patch) | |
| tree | 13e58d6d69bc1468bdd189c16e4f4ca5173dbf8d /src | |
| parent | 8301de16dafc81a3b5d94aa0707ad83bdb56a599 (diff) | |
| parent | 8339211809987bcdc4a627214f03e4479182bfc2 (diff) | |
| download | rust-7d5d59160a5e1f535ddfebb6cee22839cd253673.tar.gz rust-7d5d59160a5e1f535ddfebb6cee22839cd253673.zip | |
Rollup merge of #62021 - crlf0710:msvc_link_output_improve, r=alexcrichton
MSVC link output improve Resolves #35785. However i haven't come up with a idea to add test case for this :( r? @retep998
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_codegen_ssa/back/link.rs | 12 | ||||
| -rw-r--r-- | src/librustc_target/spec/windows_msvc_base.rs | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs index e3d297e7862..707b7cae16c 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs @@ -653,10 +653,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(); } diff --git a/src/librustc_target/spec/windows_msvc_base.rs b/src/librustc_target/spec/windows_msvc_base.rs index fdd747cdb86..b139083e99f 100644 --- a/src/librustc_target/spec/windows_msvc_base.rs +++ b/src/librustc_target/spec/windows_msvc_base.rs @@ -19,6 +19,10 @@ 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, crt_static_respected: true, |
