aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYing Wang <wangying@google.com>2013-02-13 15:46:25 -0800
committerJean-Baptiste Queru <jbq@google.com>2013-03-01 10:11:46 -0800
commit91e9de6569d5ea4a410135ec44d29539df7bab04 (patch)
treedcf91de009c58fdb5ef3f01323c72b0834553dd2
parentd9ca90b4b9bd631329e6241b1ac4824ad0821639 (diff)
downloadbuild-91e9de6569d5ea4a410135ec44d29539df7bab04.tar.gz
[DO NOT MERGE] filter -Werror if host gcc version doesn't match
Change-Id: I180bb48b1c64888f8c01881acffde8e22cbdee9a
-rw-r--r--core/binary.mk7
-rw-r--r--core/combo/HOST_linux-x86.mk3
2 files changed, 10 insertions, 0 deletions
diff --git a/core/binary.mk b/core/binary.mk
index e4882001b6..47ebb842d7 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -582,6 +582,13 @@ ifeq ($(strip $(LOCAL_RTTI_FLAG)),)
LOCAL_RTTI_FLAG := -fno-rtti
endif
+# filter out -Werror if the host gcc doesn't have the expected version
+ifdef LOCAL_IS_HOST_MODULE
+ifndef IS_EXPECTED_HOST_GCC
+LOCAL_CFLAGS := $(filter-out -Werror, $(LOCAL_CFLAGS))
+endif
+endif
+
###########################################################
# Rule-specific variable definitions
###########################################################
diff --git a/core/combo/HOST_linux-x86.mk b/core/combo/HOST_linux-x86.mk
index 5ae49728cf..c7d65b36db 100644
--- a/core/combo/HOST_linux-x86.mk
+++ b/core/combo/HOST_linux-x86.mk
@@ -42,6 +42,9 @@ HOST_AR := $(HOST_SDK_TOOLCHAIN_PREFIX)-ar
endif # $(HOST_SDK_TOOLCHAIN_PREFIX)-gcc exists
endif # TARGET_PRODUCT == sdk
+# Does the build machine have the expected gcc version?
+IS_EXPECTED_HOST_GCC := $(filter 4.4.%, $(shell $(HOST_CC) --version))
+
# We build everything in 32-bit, because some host tools are
# 32-bit-only anyway (emulator, acc), and because it gives us
# more consistency between the host tools and the target.