From be0811f46c1a9449c95e0a56c32e0950026d52d2 Mon Sep 17 00:00:00 2001 From: Zach Riggle Date: Mon, 21 Aug 2017 17:07:42 -0400 Subject: [PATCH] Enhance coverage options to include those needed by Honggfuzz for coverage-driven fuzzing Test: make m Bug: 64903541 Change-Id: Ibb7eb126b6e68c03d0336606ec540a62a8e903d4 --- core/config_sanitizers.mk | 2 +- core/fuzz_test.mk | 2 +- core/host_fuzz_test.mk | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/config_sanitizers.mk b/core/config_sanitizers.mk index c01128443..e02f03a25 100644 --- a/core/config_sanitizers.mk +++ b/core/config_sanitizers.mk @@ -175,7 +175,7 @@ ifneq ($(filter coverage,$(my_sanitize)),) ifeq ($(filter address,$(my_sanitize)),) $(error $(LOCAL_PATH): $(LOCAL_MODULE): Use of 'coverage' also requires 'address') endif - my_cflags += -fsanitize-coverage=trace-pc-guard + my_cflags += -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp my_sanitize := $(filter-out coverage,$(my_sanitize)) endif diff --git a/core/fuzz_test.mk b/core/fuzz_test.mk index 4d41871dd..7e3995add 100644 --- a/core/fuzz_test.mk +++ b/core/fuzz_test.mk @@ -8,7 +8,7 @@ ifdef LOCAL_SDK_VERSION $(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.) endif -LOCAL_CFLAGS += -fsanitize-coverage=trace-pc-guard +LOCAL_CFLAGS += -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp LOCAL_STATIC_LIBRARIES += libFuzzer ifdef LOCAL_MODULE_PATH diff --git a/core/host_fuzz_test.mk b/core/host_fuzz_test.mk index 86229113f..556e02f20 100644 --- a/core/host_fuzz_test.mk +++ b/core/host_fuzz_test.mk @@ -4,7 +4,7 @@ ################################################ $(call record-module-type,HOST_FUZZ_TEST) -LOCAL_CFLAGS += -fsanitize-coverage=trace-pc-guard +LOCAL_CFLAGS += -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp LOCAL_STATIC_LIBRARIES += libLLVMFuzzer include $(BUILD_HOST_EXECUTABLE)