diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2013-07-25 08:19:11 +0530 |
---|---|---|
committer | Vishal Bhoj <vishal.bhoj@hackbox.linaro.org> | 2014-06-06 08:07:44 +0100 |
commit | 86b15c671f4a7b9d0f35851c6ffab60f0aaec8ec (patch) | |
tree | a838af2a7b6d87ec154e0c3cffe930e59d5414e5 | |
parent | b0a96bf406e3dd7c5bc1c9085f0767d145512342 (diff) | |
download | build-86b15c671f4a7b9d0f35851c6ffab60f0aaec8ec.tar.gz |
build: Add option to disable strict-aliasing optimizations
This is useful for builds that pull in unmodified AOSP repositories
that can't be compiled with strict-aliasing compliance enabled
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
-rw-r--r-- | core/combo/TARGET_linux-arm.mk | 7 | ||||
-rw-r--r-- | core/combo/select.mk | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/core/combo/TARGET_linux-arm.mk b/core/combo/TARGET_linux-arm.mk index 000762c826..ce47f35c53 100644 --- a/core/combo/TARGET_linux-arm.mk +++ b/core/combo/TARGET_linux-arm.mk @@ -81,6 +81,13 @@ TARGET_thumb_CFLAGS := -mthumb \ -Wstrict-aliasing=2 \ -Werror=strict-aliasing +# Turn off strict-aliasing if we're building an AOSP variant without the +# patchset... +ifeq ($(DEBUG_NO_STRICT_ALIASING),yes) +TARGET_arm_CFLAGS += -fno-strict-aliasing -Wno-error=strict-aliasing +TARGET_thumb_CFLAGS += -fno-strict-aliasing -Wno-error=strict-aliasing +endif + # Set FORCE_ARM_DEBUGGING to "true" in your buildspec.mk # or in your environment to force a full arm build, even for # files that are normally built as thumb; this can make diff --git a/core/combo/select.mk b/core/combo/select.mk index 0188a5557f..61ff93a5f3 100644 --- a/core/combo/select.mk +++ b/core/combo/select.mk @@ -53,6 +53,11 @@ $(combo_target)RELEASE_CFLAGS += -Werror=strict-aliasing else $(combo_target)RELEASE_CFLAGS += -Wno-error=strict-aliasing endif +# Turn off strict-aliasing if we're building an AOSP variant without the +# patchset... +ifeq ($(DEBUG_NO_STRICT_ALIASING),yes) +$(combo_target)RELEASE_CFLAGS += -fno-strict-aliasing -Wno-error=strict-aliasing +endif $(combo_target)GLOBAL_LDFLAGS := -Wl,-O2 $(combo_target)GLOBAL_ARFLAGS := crsP |