File tree 2 files changed +9
-5
lines changed
2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -991,10 +991,15 @@ fn link_args(cmd: &mut Command,
991
991
}
992
992
993
993
if sess. targ_cfg . os == abi:: OsWindows {
994
- // Make sure that we link to the dynamic libgcc, otherwise cross-module
995
- // DWARF stack unwinding will not work.
996
- // This behavior may be overridden by --link-args "-static-libgcc"
997
- cmd. arg ( "-shared-libgcc" ) ;
994
+ if sess. targ_cfg . arch == abi:: X86 {
995
+ // Make sure that we link to the dynamic libgcc, otherwise cross-module
996
+ // DWARF stack unwinding will not work.
997
+ // This behavior may be overridden by -Clink-args="-static-libgcc"
998
+ cmd. arg ( "-shared-libgcc" ) ;
999
+ } else {
1000
+ // On Win64 unwinding is handled by the OS, so we can link libgcc statically.
1001
+ cmd. arg ( "-static-libgcc" ) ;
1002
+ }
998
1003
999
1004
// And here, we see obscure linker flags #45. On windows, it has been
1000
1005
// found to be necessary to have this flag to compile liblibc.
Original file line number Diff line number Diff line change @@ -87,7 +87,6 @@ pub type _Unwind_Exception_Cleanup_Fn =
87
87
88
88
#[ cfg( target_os = "linux" ) ]
89
89
#[ cfg( target_os = "freebsd" ) ]
90
- #[ cfg( target_os = "windows" ) ]
91
90
#[ link( name = "gcc_s" ) ]
92
91
extern { }
93
92
You can’t perform that action at this time.
0 commit comments