Default ASan options from AFL++ in libafl_targets

This commit is contained in:
Andrea Fioraldi 2021-09-27 15:24:35 +02:00
parent 96bbe37cc1
commit 54ac57b6f7
3 changed files with 20 additions and 5 deletions

View File

@ -46,8 +46,6 @@ pub const CMPLOG_MAP_H: usize = {};
println!("cargo:rerun-if-env-changed=LIBAFL_CMPLOG_MAP_W");
println!("cargo:rerun-if-env-changed=LIBAFL_CMPLOG_MAP_H");
println!("cargo:rerun-if-changed=src/common.h");
//std::env::set_var("CC", "clang");
//std::env::set_var("CXX", "clang++");
@ -78,13 +76,20 @@ pub const CMPLOG_MAP_H: usize = {};
#[cfg(feature = "libfuzzer")]
{
println!("cargo:rerun-if-changed=src/libfuzzer_compatibility.c");
println!("cargo:rerun-if-changed=src/libfuzzer.c");
cc::Build::new()
.file(src_dir.join("libfuzzer_compatibility.c"))
.compile("libfuzzer_compatibility");
.file(src_dir.join("libfuzzer.c"))
.compile("libfuzzer");
}
println!("cargo:rerun-if-changed=src/common.h");
println!("cargo:rerun-if-changed=src/common.c");
cc::Build::new()
.file(src_dir.join("common.c"))
.compile("common");
println!("cargo:rerun-if-changed=src/cmplog.h");
println!("cargo:rerun-if-changed=src/cmplog.c");

View File

@ -0,0 +1,10 @@
#include "common.h"
EXT_FUNC_IMPL(__asan_default_options, const char*, (), false) {
return "abort_on_error=1:detect_leaks=0:"
"malloc_context_size=0:symbolize=0:"
"allocator_may_return_null=1:"
"detect_odr_violation=0:handle_segv=0:"
"handle_sigbus=0:handle_abort=0:"
"handle_sigfpe=0:handle_sigill=0";
}