1########################################### 2## A thin wrapper around BUILD_EXECUTABLE 3## Common flags for fuzz tests are added. 4########################################### 5$(call record-module-type,FUZZ_TEST) 6 7ifdef LOCAL_SDK_VERSION 8 $(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.) 9endif 10 11my_fuzzer:=libFuzzer 12ifdef LOCAL_FUZZ_ENGINE 13 my_fuzzer:=$(LOCAL_FUZZ_ENGINE) 14else ifdef TARGET_FUZZ_ENGINE 15 my_fuzzer:=$(TARGET_FUZZ_ENGINE) 16endif 17 18LOCAL_SANITIZE += fuzzer 19 20ifeq ($(my_fuzzer),libFuzzer) 21LOCAL_STATIC_LIBRARIES += libFuzzer 22else 23$(call pretty-error, Unknown fuzz engine $(my_fuzzer)) 24endif 25 26ifdef LOCAL_MODULE_PATH 27$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE)) 28endif 29 30ifdef LOCAL_MODULE_PATH_32 31$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE)) 32endif 33 34ifdef LOCAL_MODULE_PATH_64 35$(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE)) 36endif 37 38LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE) 39LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(my_fuzzer)/$(LOCAL_MODULE) 40 41ifndef LOCAL_STRIP_MODULE 42LOCAL_STRIP_MODULE := keep_symbols 43endif 44 45include $(BUILD_EXECUTABLE) 46