Skip to content

Commit 61a59a5

Browse files
authored
Rollup merge of rust-lang#73241 - mati865:mingw-libs-order-comment, r=petrochenkov
Add/update comments about MinGW late_link_args
2 parents f738423 + 5a841b9 commit 61a59a5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/librustc_target/spec/windows_gnu_base.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ pub fn opts() -> TargetOptions {
1717
let mut late_link_args = LinkArgs::new();
1818
let mut late_link_args_dynamic = LinkArgs::new();
1919
let mut late_link_args_static = LinkArgs::new();
20+
// Order of `late_link_args*` was found through trial and error to work with various
21+
// mingw-w64 versions (not tested on the CI). It's expected to change from time to time.
2022
late_link_args.insert(
2123
LinkerFlavor::Gcc,
2224
vec![
@@ -27,10 +29,9 @@ pub fn opts() -> TargetOptions {
2729
// And it seems that the linker fails to use import symbols from msvcrt
2830
// that are required from functions in msvcrt in certain cases. For example
2931
// `_fmode` that is used by an implementation of `__p__fmode` in x86_64.
30-
// Listing the library twice seems to fix that, and seems to also be done
31-
// by mingw's gcc (Though not sure if it's done on purpose, or by mistake).
32+
// The library is purposely listed twice to fix that.
3233
//
33-
// See https://github.com/rust-lang/rust/pull/47483
34+
// See https://github.com/rust-lang/rust/pull/47483 for some more details.
3435
"-lmsvcrt".to_string(),
3536
"-luser32".to_string(),
3637
"-lkernel32".to_string(),

0 commit comments

Comments
 (0)