Dan Albert | 36b6f04 | 2015-07-30 16:56:30 -0700 | [diff] [blame] | 1 | ########################################### |
| 2 | ## A thin wrapper around BUILD_EXECUTABLE |
| 3 | ## Common flags for fuzz tests are added. |
| 4 | ########################################### |
Dan Willemsen | 3bf15e7 | 2016-07-25 16:03:53 -0700 | [diff] [blame] | 5 | $(call record-module-type,FUZZ_TEST) |
Dan Albert | 36b6f04 | 2015-07-30 16:56:30 -0700 | [diff] [blame] | 6 | |
| 7 | ifdef LOCAL_SDK_VERSION |
| 8 | $(error $(LOCAL_PATH): $(LOCAL_MODULE): NDK fuzz tests are not supported.) |
| 9 | endif |
| 10 | |
Ivan Krasin | 74b32b8 | 2015-09-18 11:54:43 -0700 | [diff] [blame] | 11 | LOCAL_CFLAGS += -fsanitize-coverage=edge,indirect-calls,8bit-counters,trace-cmp |
Dan Albert | 36b6f04 | 2015-07-30 16:56:30 -0700 | [diff] [blame] | 12 | LOCAL_STATIC_LIBRARIES += libLLVMFuzzer |
| 13 | |
| 14 | ifdef LOCAL_MODULE_PATH |
| 15 | $(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH when building test $(LOCAL_MODULE)) |
| 16 | endif |
| 17 | |
| 18 | ifdef LOCAL_MODULE_PATH_32 |
| 19 | $(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_32 when building test $(LOCAL_MODULE)) |
| 20 | endif |
| 21 | |
| 22 | ifdef LOCAL_MODULE_PATH_64 |
| 23 | $(error $(LOCAL_PATH): Do not set LOCAL_MODULE_PATH_64 when building test $(LOCAL_MODULE)) |
| 24 | endif |
| 25 | |
Vishwath Mohan | b6baba0 | 2016-09-02 13:25:59 -0700 | [diff] [blame] | 26 | LOCAL_MODULE_PATH_64 := $(TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(LOCAL_MODULE) |
| 27 | LOCAL_MODULE_PATH_32 := $($(TARGET_2ND_ARCH_VAR_PREFIX)TARGET_OUT_DATA_NATIVE_TESTS)/fuzzers/$(LOCAL_MODULE) |
Dan Albert | 36b6f04 | 2015-07-30 16:56:30 -0700 | [diff] [blame] | 28 | |
| 29 | ifndef LOCAL_MULTILIB |
| 30 | ifndef LOCAL_32_BIT_ONLY |
| 31 | LOCAL_MULTILIB := both |
| 32 | endif |
| 33 | endif |
| 34 | |
| 35 | include $(BUILD_EXECUTABLE) |