fuzzer without sanitizers, can't compiled shared library due to undefined references

266 views
Skip to first unread message

Xavier Maso

unread,
Jul 23, 2021, 3:13:54 PM7/23/21
to libfuzzer
I am trying to compile a shared library for fuzzing.

When I use `-fsanitize=fuzzer-no-link,address -shared-libasan`, everything works fine.

However, I would like to make a similar build, but without ASan (why: https://github.com/rr-debugger/rr does not support ASan, and it would be really helpful to use for the bug I am tracking down).
Using `-fsanitize=fuzzer-no-link`, both at compile and link time, I get many linking errors about undefined references (for `__sancov_lowest_stack`,  and `__sanitizer_cov_trace_const_cmp*` particularly).

This SO answer https://stackoverflow.com/a/54722009/3297959 says the culprit should be a missing linker flag, but the flag is present in my case!

In attachment, the log of the different compilation commands that are run.
(for some context, I am working on fuzzing https://github.com/nixos/nix, and I am using `meson`)
AFAICT, in the log, I can see the `-fsanitize=fuzzer-no-link` being applied to each object file being compiled (`[1/18]` - `[17/18]`), and also to the `.so` (`[18/18]`).

Any ideas about what I am missing?
log.txt
Reply all
Reply to author
Forward
0 new messages