Make the build more fuzzer-friendly
This change adds support for the USE_ASAN=yes env variable, that builds
all minijail artifacts with -fsanitize=address. It also makes die() not
call abort(2) on failures, which confuses afl.
Bug: None
Test: minijail$ USE_ASAN=yes make clean all tests 2>/dev/null >/dev/null && \
readelf -a syscall_filter_unittest | grep __asan_init
000000313720 006200000001 R_X86_64_64 0000000000000000 __asan_init + 0
00000031b9b0 006200000007 R_X86_64_JUMP_SLO 0000000000000000 __asan_init + 0
98: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __asan_init
1330: 0000000000000000 0 FUNC GLOBAL DEFAULT UND __asan_init
minijail$ USE_ASAN=no make clean all tests 2>/dev/null >/dev/null && \
readelf -a syscall_filter_unittest | grep __asan_init
minijail$
Test: USE_EXIT_ON_DIE=no make clean parse_seccomp_policy &&
./parse_seccomp_policy test/invalid_arg_filter.policy # aborts
Test: USE_EXIT_ON_DIE=yes make clean parse_seccomp_policy &&
./parse_seccomp_policy test/invalid_arg_filter.policy # exits
Change-Id: Ib9dcb271cd75335edd8b109149caf825f346322f
2 files changed