Merge "Upgrade x86 gcc to 4.9 and disable devirtualization."
diff --git a/core/clang/config.mk b/core/clang/config.mk
index 7947e61..512b116 100644
--- a/core/clang/config.mk
+++ b/core/clang/config.mk
@@ -68,10 +68,13 @@
-finline-functions \
-finline-limit=64 \
-fno-canonical-system-headers \
+ -Wno-clobbered \
+ -fno-devirtualize \
-fno-tree-sra \
-fprefetch-loop-arrays \
-funswitch-loops \
-Wmaybe-uninitialized \
+ -Wno-error=clobbered \
-Wno-error=maybe-uninitialized \
-Wno-error=unused-but-set-parameter \
-Wno-error=unused-but-set-variable \
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk
index 5756220..482889d 100644
--- a/core/combo/TARGET_linux-x86.mk
+++ b/core/combo/TARGET_linux-x86.mk
@@ -23,10 +23,10 @@
endif
# Decouple NDK library selection with platform compiler version
-$(combo_2nd_arch_prefix)TARGET_NDK_GCC_VERSION := 4.8
+$(combo_2nd_arch_prefix)TARGET_NDK_GCC_VERSION := 4.9
ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),)
-$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := 4.8
+$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := 4.9
else
$(combo_2nd_arch_prefix)TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP)
endif
@@ -97,6 +97,10 @@
-include $(android_config_h) \
-I $(dir $(android_config_h))
+# Work around gcc 4.9 devirtualization bug, https://b.corp.google.com/19872411.
+$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += \
+ -fno-devirtualize \
+
$(combo_2nd_arch_prefix)TARGET_GLOBAL_CFLAGS += $(arch_variant_cflags)
ifeq ($(ARCH_X86_HAVE_SSSE3),true) # yes, really SSSE3, not SSE3!
diff --git a/core/combo/TARGET_linux-x86_64.mk b/core/combo/TARGET_linux-x86_64.mk
index eac8268..c705b95 100644
--- a/core/combo/TARGET_linux-x86_64.mk
+++ b/core/combo/TARGET_linux-x86_64.mk
@@ -26,7 +26,7 @@
TARGET_NDK_GCC_VERSION := 4.9
ifeq ($(strip $(TARGET_GCC_VERSION_EXP)),)
-TARGET_GCC_VERSION := 4.8
+TARGET_GCC_VERSION := 4.9
else
TARGET_GCC_VERSION := $(TARGET_GCC_VERSION_EXP)
endif
@@ -93,6 +93,10 @@
-no-canonical-prefixes \
-fno-canonical-system-headers
+# Work around gcc 4.9 devirtualization bug, https://b.corp.google.com/19872411.
+TARGET_GLOBAL_CFLAGS += \
+ -fno-devirtualize \
+
# Help catch common 32/64-bit errors.
TARGET_GLOBAL_CFLAGS += \
-Werror=pointer-to-int-cast \