Skip to content

Commit

Permalink
Rollup merge of #73184 - mati865:fix-mingw-libs-order, r=petrochenkov
Browse files Browse the repository at this point in the history
Reoder order in which MinGW libs are linked to fix recent breakage

Recent upstream mingw-w64 changes made libmsvcrt depend on libmingwex breaking compilation in some cases when using **external** MinGW.

Applying this change to the master fixes nightly and stage{1,2} build. For stage0 one has to export `RUSTFLAGS_BOOTSTRAP='-C link-arg=-lmsvcrt'` until this PR lands in bootstrap compiler.
Therefore I'm humbly asking to also backport it to the beta and update bootstrap compiler.
  • Loading branch information
Dylan-DPC committed Jun 10, 2020
2 parents e04e3c8 + e237e02 commit 2b8f1ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustc_target/spec/windows_gnu_base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ pub fn opts() -> TargetOptions {
late_link_args.insert(
LinkerFlavor::Gcc,
vec![
"-lmsvcrt".to_string(),
"-lmingwex".to_string(),
"-lmingw32".to_string(),
"-lmsvcrt".to_string(),
// mingw's msvcrt is a weird hybrid import library and static library.
// And it seems that the linker fails to use import symbols from msvcrt
// that are required from functions in msvcrt in certain cases. For example
Expand Down

0 comments on commit 2b8f1ec

Please sign in to comment.