diff options
author | Dan Albert <danalbert@google.com> | 2014-10-07 23:37:53 -0700 |
---|---|---|
committer | Dan Albert <danalbert@google.com> | 2014-10-08 17:05:19 -0700 |
commit | 4c12c0303c705ee4cc87344adbd62087539c7729 (patch) | |
tree | 1d3b4d494d8d9ee24a9f80c909f4839ea588ed7d | |
parent | 8330c4c5e6f8bb8b64e1b45ceed603b49853a086 (diff) | |
download | build-4c12c0303c705ee4cc87344adbd62087539c7729.zip build-4c12c0303c705ee4cc87344adbd62087539c7729.tar.gz build-4c12c0303c705ee4cc87344adbd62087539c7729.tar.bz2 |
LOCAL_NATIVE_COVERAGE should imply -O0.
Optimization can lead to incorrect coverage results.
Change-Id: I8ade9ab246e292d26ac18821baf9970e29dc1a1f
-rw-r--r-- | core/binary.mk | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/core/binary.mk b/core/binary.mk index 7b77fb2..efb0db0 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -259,8 +259,10 @@ my_target_global_cppflags += $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_CPPFLAG my_target_global_ldflags := $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_GLOBAL_LDFLAGS) endif # my_clang -# If the global flag NATIVE_COVERAGE is set, my_native_coverage will be true -# unless the module explicitly sets my_native_coverage := false. +# To enable coverage for a given module, set LOCAL_NATIVE_COVERAGE=true and +# build with NATIVE_COVERAGE=true in your enviornment. Note that the build +# system is not sensitive to changes to NATIVE_COVERAGE, so you should do a +# clean build of your module after toggling it. ifeq ($(NATIVE_COVERAGE),true) ifeq ($(my_native_coverage),true) # We can't currently generate coverage for clang binaries for two @@ -276,8 +278,8 @@ ifeq ($(NATIVE_COVERAGE),true) # -no-integrated-as. Since most of the assembly in our tree is # incompatible with clang's assembler, we can't turn off this flag. ifneq ($(my_clang),true) - my_target_global_cflags += --coverage - my_target_global_ldflags += --coverage + my_cflags += --coverage -O0 + my_ldflags += --coverage endif endif else |