no coverage info on Android(build target with -fsanitize=address)
- Dominant language
- C
- Stars
- 3.4k
- Forks
- 539
- PR merge metrics
- No merged PRs in 30d
Description
I got same situation as https://github.com/google/honggfuzz/issues/342
I try to add `-fsanitize-coverage=trace-pc-guard,trace-cmp,trace-div,indirect-calls`, but I got many warnings:
```
WARNING: found 1 unrecognized flag(s):
detect_odr_violation
```
I checked [google's doc](https://developer.android.com/ndk/guides/asan) :
in `Application.mk` :
```
APP_STL := c++_shared # Or system, or none.
APP_CFLAGS := -fsanitize=address -fno-omit-frame-pointer
APP_LDFLAGS := -fsanitize=address
```
For each module in your `Android.mk`:
```
LOCAL_ARM_MODE := arm
```
---
so I modified my demo as follow:
```
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_PATH = .
LOCAL_MODULE := hfuzz
LOCAL_EXPORT_C_INCLUDES := $HOME/honggfuzz/includes
LOCAL_SRC_FILES := /home/user/honggfuzz/libs/arm64-v8a/libhfuzz.a
LOCAL_ARM_MODE := arm
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_PATH = .
LOCAL_MODULE := hfuzzcommon
LOCAL_EXPORT_C_INCLUDES := $HOME/honggfuzz/includes
LOCAL_SRC_FILES := /home/user/honggfuzz/obj/local/arm64-v8a/libcommon.a
LOCAL_ARM_MODE := arm
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
LOCAL_STATIC_LIBRARIES := hfuzz hfuzzcommon
LOCAL_SRC_FILES := fuzz_test.c
LOCAL_MODULE := fuzz_test
LOCAL_ARM_MODE := arm
include $(BUILD_EXECUTABLE)
```
```
cat Application.mk
APP_BUILD_SCRIPT := ./Android.mk
APP_STL := c++_shared # Or system, or none.
APP_CFLAGS := -fsanitize=address -fno-omit-frame-pointer
APP_LDFLAGS := -fsanitize=address
```
After `ndk-build`, I test it on my pixel2 :

It seems ASAN works fine.
But when I try to fuzzing `fuzz_test` with honggfuzz, I find I cannot get any coverage infomation :
```
./honggfuzz -i in -o out -z -- fuzz_test ___FILE___
```

What I did wrong? Could you suggest something, please?
Contributor guide
Assessment
This issue has not been assessed yet.