2015-07-31 01:56:30 +02:00
|
|
|
###########################################
|
|
|
|
## A thin wrapper around BUILD_EXECUTABLE
|
|
|
|
## Common flags for fuzz tests are added.
|
|
|
|
###########################################
|
2016-07-26 01:03:53 +02:00
|
|
|
$(call record-module-type,FUZZ_TEST)
|
2015-07-31 01:56:30 +02:00
|
|
|
|
|
|
|
ifdef LOCAL_SDK_VERSION
|
|
|
|
$(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.)
|
|
|
|
endif
|
|
|
|
|
2017-12-21 23:04:03 +01:00
|
|
|
my_fuzzer:=libFuzzer
|
|
|
|
ifdef LOCAL_FUZZ_ENGINE
|
|
|
|
my_fuzzer:=$(LOCAL_FUZZ_ENGINE)
|
|
|
|
else ifdef TARGET_FUZZ_ENGINE
|
|
|
|
my_fuzzer:=$(TARGET_FUZZ_ENGINE)
|
|
|
|
endif
|
|
|
|
|
2019-05-01 23:37:33 +02:00
|
|
|
LOCAL_SANITIZE += fuzzer
|
2017-12-21 23:04:03 +01:00
|
|
|
|
|
|
|
ifeq ($(my_fuzzer),libFuzzer)
|
2017-04-19 19:56:45 +02:00
|
|
|
LOCAL_STATIC_LIBRARIES += libFuzzer
|
2017-12-21 23:04:03 +01:00
|
|
|
else
|
|
|
|
$(call pretty-error, Unknown fuzz engine $(my_fuzzer))
|
|
|
|
endif
|
2015-07-31 01:56:30 +02:00
|
|
|
|
|
|
|
ifdef LOCAL_MODULE_PATH
|
|
|
|
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef LOCAL_MODULE_PATH_32
|
|
|
|
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef LOCAL_MODULE_PATH_64
|
|
|
|
$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE))
|
|
|
|
endif
|
|
|
|
|
2018-03-26 21:47:31 +02:00
|
|
|
LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE)
|
|
|
|
LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE)
|
2015-07-31 01:56:30 +02:00
|
|
|
|
2018-01-03 20:32:14 +01:00
|
|
|
ifndef LOCAL_STRIP_MODULE
|
|
|
|
LOCAL_STRIP_MODULE := keep_symbols
|
|
|
|
endif
|
|
|
|
|
2015-07-31 01:56:30 +02:00
|
|
|
include $(BUILD_EXECUTABLE)
|