From af68337d36aea2f347dfb58ab1c6448516b084e0 Mon Sep 17 00:00:00 2001 From: Pirama Arumuga Nainar Date: Wed, 9 Sep 2020 17:54:32 -0700 Subject: [PATCH] Set -fsjlj-exceptions for all 32-bit Windows compiles Bug: http://b/116784799 Previously this was set only when stl was requested. We can now pass this for all C++ compilations. Test: go/android-llvm-windows-testing Change-Id: I43e635ff50d0f1a5e000f13021506aeece368b4a --- cc/config/x86_windows_host.go | 6 +++++- cc/stl.go | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go index cd0a50837..b5b555322 100644 --- a/cc/config/x86_windows_host.go +++ b/cc/config/x86_windows_host.go @@ -49,7 +49,11 @@ var ( windowsClangCppflags = []string{} - windowsX86ClangCppflags = []string{} + windowsX86ClangCppflags = []string{ + // Use SjLj exceptions for 32-bit. libgcc_eh implements SjLj + // exception model for 32-bit. + "-fsjlj-exceptions", + } windowsX8664ClangCppflags = []string{} diff --git a/cc/stl.go b/cc/stl.go index 4e74c7fb0..e18fe9547 100644 --- a/cc/stl.go +++ b/cc/stl.go @@ -239,11 +239,6 @@ func (stl *stl) flags(ctx ModuleContext, flags Flags) Flags { flags.Local.CppFlags = append(flags.Local.CppFlags, "-nostdinc++") flags.extraLibFlags = append(flags.extraLibFlags, "-nostdlib++") if ctx.Windows() { - // Use SjLj exceptions for 32-bit. libgcc_eh implements SjLj - // exception model for 32-bit. - if ctx.Arch().ArchType == android.X86 { - flags.Local.CppFlags = append(flags.Local.CppFlags, "-fsjlj-exceptions") - } flags.Local.CppFlags = append(flags.Local.CppFlags, // Disable visiblity annotations since we're using static // libc++.