File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 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,
991991 }
992992
993993 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+ }
9981003
9991004 // And here, we see obscure linker flags #45. On windows, it has been
10001005 // 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 =
8787
8888#[ cfg( target_os = "linux" ) ]
8989#[ cfg( target_os = "freebsd" ) ]
90- #[ cfg( target_os = "windows" ) ]
9190#[ link( name = "gcc_s" ) ]
9291extern { }
9392
You can’t perform that action at this time.
0 commit comments