am ad48a465: am d400f774: am dcac4582: Merge "Add support for LOCAL_DETECT_INTEGER_OVERFLOWS"

* commit 'ad48a4655a09811cb43d261f3f101fadfe58f695':
  Add support for LOCAL_DETECT_INTEGER_OVERFLOWS
This commit is contained in:
Nick Kralevich 2015-06-15 22:42:04 +00:00 committed by Android Git Automerger
commit fd9b5a6e5a
2 changed files with 11 additions and 0 deletions

View file

@ -151,6 +151,7 @@ LOCAL_CTS_TEST_PACKAGE:=
LOCAL_CTS_TEST_RUNNER:=
LOCAL_CLANG:=
LOCAL_ADDRESS_SANITIZER:=
LOCAL_DETECT_INTEGER_OVERFLOWS:=
LOCAL_JAR_EXCLUDE_FILES:=
LOCAL_JAR_PACKAGES:=
LOCAL_JAR_EXCLUDE_PACKAGES:=

View file

@ -105,3 +105,13 @@ ifneq ($(strip $(LOCAL_SANITIZE_RECOVER)),)
recover_arg := $(subst $(space),$(comma),$(LOCAL_SANITIZE_RECOVER)),
my_cflags += -fsanitize-recover=$(recover_arg)
endif
ifeq ($(strip $(LOCAL_DETECT_INTEGER_OVERFLOWS)),true)
ifeq ($(my_clang),true)
my_cflags += -fsanitize=signed-integer-overflow,unsigned-integer-overflow
my_cflags += -ftrap-function=abort
my_cflags += -fsanitize-undefined-trap-on-error
else
$(error $(LOCAL_MODULE): You must enable LOCAL_CLANG:=true to use LOCAL_DETECT_INTEGER_OVERFLOWS)
endif
endif