diff options
author | Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> | 2013-07-25 08:19:11 +0530 |
---|---|---|
committer | Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> | 2013-10-15 21:38:47 +0200 |
commit | e614fe0b4c939dfcbb93cd3e5205b206e3e67038 (patch) | |
tree | f353fbeeb245c929a4a908d42cbd6d999515026d | |
parent | 9e9b64dab7a9bfcd4942fcfd4803314f2c0cacf7 (diff) | |
download | build-e614fe0b4c939dfcbb93cd3e5205b206e3e67038.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 71447f790f..476f771781 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 |