platform_build/core/fuzz_test.mk
Elliott Hughes a445ef6cde Remove honggfuzz support.
Everyone's on libFuzzer now.

(The "fuzz" referred to in base_system.mk was removed in Android 11, but
this reference was left lying around.)

Bug: http://b/184301511
Test: treehugger
Change-Id: I6fe0f2c37e014647802279a656d2c6c9625b7a44
2021-04-02 10:24:48 -07:00

45 lines
1.3 KiB
Makefile

###########################################
## A thin wrapper around BUILD_EXECUTABLE
## Common flags for fuzz tests are added.
###########################################
$(call record-module-type,FUZZ_TEST)
ifdef LOCAL_SDK_VERSION
$(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.)
endif
my_fuzzer:=libFuzzer
ifdef LOCAL_FUZZ_ENGINE
my_fuzzer:=$(LOCAL_FUZZ_ENGINE)
else ifdef TARGET_FUZZ_ENGINE
my_fuzzer:=$(TARGET_FUZZ_ENGINE)
endif
LOCAL_SANITIZE += fuzzer
ifeq ($(my_fuzzer),libFuzzer)
LOCAL_STATIC_LIBRARIES += libFuzzer
else
$(call pretty-error, Unknown fuzz engine $(my_fuzzer))
endif
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
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)
ifndef LOCAL_STRIP_MODULE
LOCAL_STRIP_MODULE := keep_symbols
endif
include $(BUILD_EXECUTABLE)