about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorDylan DPC <dylan.dpc@gmail.com>2020-06-10 11:03:51 +0200
committerGitHub <noreply@github.com>2020-06-10 11:03:51 +0200
commit2b8f1eccaa138a2a4af61356231c33d7d93ed993 (patch)
treee11ea54626fd31337cbacebc71ef475e630604d8 /src
parente04e3c89cc08546c5c762ea915cb72d4069a733e (diff)
parente237e0280b301457e5cc4bf6d559e91373a17d65 (diff)
downloadrust-2b8f1eccaa138a2a4af61356231c33d7d93ed993.tar.gz
rust-2b8f1eccaa138a2a4af61356231c33d7d93ed993.zip
Rollup merge of #73184 - mati865:fix-mingw-libs-order, r=petrochenkov
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.
Diffstat (limited to 'src')
-rw-r--r--src/librustc_target/spec/windows_gnu_base.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_target/spec/windows_gnu_base.rs b/src/librustc_target/spec/windows_gnu_base.rs
index f556bf03f02..744f26239ca 100644
--- a/src/librustc_target/spec/windows_gnu_base.rs
+++ b/src/librustc_target/spec/windows_gnu_base.rs
@@ -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