File tree 1 file changed +9
-1
lines changed
1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -59,7 +59,15 @@ pub fn opts() -> TargetOptions {
59
59
"-lmingw32" . to_string( ) ,
60
60
"-lgcc" . to_string( ) , // alas, mingw* libraries above depend on libgcc
61
61
"-lmsvcrt" . to_string( ) ,
62
- "-lmsvcrt" . to_string( ) , // mingw is insane...?
62
+ // mingw's msvcrt is a weird hybrid import library and static library.
63
+ // And it seems that the linker fails to use import symbols from msvcrt
64
+ // that are required from functions in msvcrt in certain cases. For example
65
+ // `_fmode` that is used by an implementation of `__p__fmode` in x86_64.
66
+ // Listing the library twice seems to fix that, and seems to also be done
67
+ // by mingw's gcc (Though not sure if it's done on purpose, or by mistake).
68
+ //
69
+ // See https://github.com/rust-lang/rust/pull/47483
70
+ "-lmsvcrt" . to_string( ) ,
63
71
"-luser32" . to_string( ) ,
64
72
"-lkernel32" . to_string( ) ,
65
73
] ) ;
You can’t perform that action at this time.
0 commit comments