diff options
author | van Hauser <vh@thc.org> | 2021-04-16 13:53:08 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-16 13:53:08 +0200 |
commit | 400ab10cfdfdb25235bf0483bc0fa0332ae11461 (patch) | |
tree | c5f5c705b502109917f722ed79549e281f5a02c3 /src/afl-cc.c | |
parent | 98989f1088d04dd4c0d21834c38b7683f1cfb42d (diff) | |
parent | 5dad04867461e93cefd1ecee6d336fa4d9ef632d (diff) | |
download | afl++-400ab10cfdfdb25235bf0483bc0fa0332ae11461.tar.gz |
Merge branch 'dev' into dev
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r-- | src/afl-cc.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c index b354077e..1f89bac5 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -430,9 +430,6 @@ static void edit_params(u32 argc, char **argv, char **envp) { cc_params[cc_par_cnt++] = "-Wno-unused-command-line-argument"; - if (lto_mode && plusplus_mode) - cc_params[cc_par_cnt++] = "-lc++"; // needed by fuzzbench, early - if (lto_mode && have_instr_env) { cc_params[cc_par_cnt++] = "-Xclang"; @@ -819,6 +816,14 @@ static void edit_params(u32 argc, char **argv, char **envp) { } + if (getenv("AFL_USE_LSAN")) { + + cc_params[cc_par_cnt++] = "-fsanitize=leak"; + cc_params[cc_par_cnt++] = "-includesanitizer/lsan_interface.h"; + cc_params[cc_par_cnt++] = "-D__AFL_LEAK_CHECK()=__lsan_do_leak_check()"; + + } + if (getenv("AFL_USE_CFISAN")) { if (!lto_mode) { @@ -1730,7 +1735,8 @@ int main(int argc, char **argv, char **envp) { " AFL_USE_ASAN: activate address sanitizer\n" " AFL_USE_CFISAN: activate control flow sanitizer\n" " AFL_USE_MSAN: activate memory sanitizer\n" - " AFL_USE_UBSAN: activate undefined behaviour sanitizer\n"); + " AFL_USE_UBSAN: activate undefined behaviour sanitizer\n" + " AFL_USE_LSAN: activate leak-checker sanitizer\n"); if (have_gcc_plugin) SAYF( |