From abf1b31a201acf4218b9ff63a51a66b50a9108bb Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Mon, 25 Jun 2018 16:42:23 -0700 Subject: [PATCH] Use -static-libgcc for Windows Bug: http://b/69970955 With the MinGW prebuilts update (http://aosp/709402), executables get a runtime dependency on libgcc_s_sjlj-1.dll with both gcc and Clang. Passing -static-libgcc removes this dependency and is a better option than having to package an extra dll with executables. Test: Run gcc-built adb_test.exe under wine Change-Id: I18e5fadb1b8ace510ae684e2d4cfa7fe7d007cff --- cc/config/x86_windows_host.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go index 6fbff9f19..4e13230bb 100644 --- a/cc/config/x86_windows_host.go +++ b/cc/config/x86_windows_host.go @@ -79,6 +79,7 @@ var ( "-m32", "-Wl,--large-address-aware", "-L${WindowsGccRoot}/${WindowsGccTriple}/lib32", + "-static-libgcc", } windowsX86ClangLdflags = append(ClangFilterUnknownCflags(windowsX86Ldflags), []string{ "-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3/32", @@ -90,6 +91,7 @@ var ( windowsX8664Ldflags = []string{ "-m64", "-L${WindowsGccRoot}/${WindowsGccTriple}/lib64", + "-static-libgcc", } windowsX8664ClangLdflags = append(ClangFilterUnknownCflags(windowsX8664Ldflags), []string{ "-B${WindowsGccRoot}/lib/gcc/${WindowsGccTriple}/4.8.3",