Skip to content

Commit 2b8f1ec

Browse files
authored
Rollup merge of rust-lang#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.
2 parents e04e3c8 + e237e02 commit 2b8f1ec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_target/spec/windows_gnu_base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ pub fn opts() -> TargetOptions {
2020
late_link_args.insert(
2121
LinkerFlavor::Gcc,
2222
vec![
23+
"-lmsvcrt".to_string(),
2324
"-lmingwex".to_string(),
2425
"-lmingw32".to_string(),
25-
"-lmsvcrt".to_string(),
2626
// mingw's msvcrt is a weird hybrid import library and static library.
2727
// And it seems that the linker fails to use import symbols from msvcrt
2828
// that are required from functions in msvcrt in certain cases. For example

0 commit comments

Comments
 (0)