@@ -23,6 +23,7 @@ pub fn opts() -> TargetOptions {
23
23
"-lmsvcrt" . to_string( ) ,
24
24
"-lmingwex" . to_string( ) ,
25
25
"-lmingw32" . to_string( ) ,
26
+ "-lgcc" . to_string( ) , // alas, mingw* libraries above depend on libgcc
26
27
// mingw's msvcrt is a weird hybrid import library and static library.
27
28
// And it seems that the linker fails to use import symbols from msvcrt
28
29
// that are required from functions in msvcrt in certain cases. For example
@@ -41,8 +42,6 @@ pub fn opts() -> TargetOptions {
41
42
// the shared libgcc_s-dw2-1.dll. This is required to support
42
43
// unwinding across DLL boundaries.
43
44
"-lgcc_s" . to_string( ) ,
44
- "-lgcc" . to_string( ) ,
45
- "-lkernel32" . to_string( ) ,
46
45
] ;
47
46
late_link_args_dynamic. insert ( LinkerFlavor :: Gcc , dynamic_unwind_libs. clone ( ) ) ;
48
47
late_link_args_dynamic. insert ( LinkerFlavor :: Lld ( LldFlavor :: Ld ) , dynamic_unwind_libs) ;
@@ -54,10 +53,6 @@ pub fn opts() -> TargetOptions {
54
53
// boundaries when unwinding across FFI boundaries.
55
54
"-lgcc_eh" . to_string( ) ,
56
55
"-l:libpthread.a" . to_string( ) ,
57
- "-lgcc" . to_string( ) ,
58
- // libpthread depends on libmsvcrt, so we need to link it *again*.
59
- "-lmsvcrt" . to_string( ) ,
60
- "-lkernel32" . to_string( ) ,
61
56
] ;
62
57
late_link_args_static. insert ( LinkerFlavor :: Gcc , static_unwind_libs. clone ( ) ) ;
63
58
late_link_args_static. insert ( LinkerFlavor :: Lld ( LldFlavor :: Ld ) , static_unwind_libs) ;
0 commit comments