File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 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 {
5959 "-lmingw32" . to_string( ) ,
6060 "-lgcc" . to_string( ) , // alas, mingw* libraries above depend on libgcc
6161 "-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( ) ,
6371 "-luser32" . to_string( ) ,
6472 "-lkernel32" . to_string( ) ,
6573 ] ) ;
You can’t perform that action at this time.
0 commit comments