Skip to content

Commit

Permalink
Rollup merge of rust-lang#62021 - crlf0710:msvc_link_output_improve, …
Browse files Browse the repository at this point in the history
…r=alexcrichton

MSVC link output improve

Resolves rust-lang#35785.

However i haven't come up with a idea to add test case for this :(

r? @retep998
  • Loading branch information
Centril committed Jul 1, 2019
2 parents 765eebf + 8339211 commit 548132b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/librustc_codegen_ssa/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
4 changes: 4 additions & 0 deletions src/librustc_target/spec/windows_msvc_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 548132b

Please sign in to comment.