@@ -23,6 +23,7 @@ pub fn opts() -> TargetOptions {
2323 "-lmsvcrt" . to_string( ) ,
2424 "-lmingwex" . to_string( ) ,
2525 "-lmingw32" . to_string( ) ,
26+ "-lgcc" . to_string( ) , // alas, mingw* libraries above depend on libgcc
2627 // mingw's msvcrt is a weird hybrid import library and static library.
2728 // And it seems that the linker fails to use import symbols from msvcrt
2829 // that are required from functions in msvcrt in certain cases. For example
@@ -41,8 +42,6 @@ pub fn opts() -> TargetOptions {
4142 // the shared libgcc_s-dw2-1.dll. This is required to support
4243 // unwinding across DLL boundaries.
4344 "-lgcc_s" . to_string( ) ,
44- "-lgcc" . to_string( ) ,
45- "-lkernel32" . to_string( ) ,
4645 ] ;
4746 late_link_args_dynamic. insert ( LinkerFlavor :: Gcc , dynamic_unwind_libs. clone ( ) ) ;
4847 late_link_args_dynamic. insert ( LinkerFlavor :: Lld ( LldFlavor :: Ld ) , dynamic_unwind_libs) ;
@@ -54,10 +53,6 @@ pub fn opts() -> TargetOptions {
5453 // boundaries when unwinding across FFI boundaries.
5554 "-lgcc_eh" . to_string( ) ,
5655 "-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( ) ,
6156 ] ;
6257 late_link_args_static. insert ( LinkerFlavor :: Gcc , static_unwind_libs. clone ( ) ) ;
6358 late_link_args_static. insert ( LinkerFlavor :: Lld ( LldFlavor :: Ld ) , static_unwind_libs) ;
0 commit comments