diff options
-rw-r--r-- | core/binary.mk | 7 | ||||
-rw-r--r-- | core/combo/HOST_linux-x86.mk | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/core/binary.mk b/core/binary.mk index 51207063e0..f6c4dc49be 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -477,6 +477,13 @@ installed_static_library_notice_file_targets := \ $(foreach lib,$(LOCAL_STATIC_LIBRARIES) $(LOCAL_WHOLE_STATIC_LIBRARIES), \ NOTICE-$(if $(LOCAL_IS_HOST_MODULE),HOST,TARGET)-STATIC_LIBRARIES-$(lib)) +# 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 c871613fe0..445c12f4e0 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. |