Non weak default sanitizers options functions (#519)
This commit is contained in:
parent
0062bab412
commit
f527aab15e
@ -11,9 +11,10 @@ keywords = ["fuzzing", "testing"]
|
||||
edition = "2021"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
default = ["std", "sanitizers_flags"]
|
||||
std = ["libafl/std"]
|
||||
libfuzzer = []
|
||||
sanitizers_flags = []
|
||||
pointer_maps = []
|
||||
sancov_pcguard_edges = []
|
||||
sancov_pcguard_hitcounts = []
|
||||
|
@ -92,9 +92,14 @@ fn main() {
|
||||
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");
|
||||
let mut common = cc::Build::new();
|
||||
|
||||
#[cfg(feature = "sanitizers_flags")]
|
||||
{
|
||||
common.define("DEFAULT_SANITIZERS_OPTIONS", "1");
|
||||
}
|
||||
|
||||
common.file(src_dir.join("common.c")).compile("common");
|
||||
|
||||
println!("cargo:rerun-if-changed=src/coverage.c");
|
||||
|
||||
|
@ -1,6 +1,9 @@
|
||||
#include "common.h"
|
||||
|
||||
EXT_FUNC_IMPL(__asan_default_options, const char*, (), false) {
|
||||
#ifdef DEFAULT_SANITIZERS_OPTIONS
|
||||
// TODO MSan and LSan. however they don't support abort_on_error
|
||||
|
||||
const char* __asan_default_options() {
|
||||
return "abort_on_error=1:detect_leaks=0:"
|
||||
"malloc_context_size=0:symbolize=0:"
|
||||
"allocator_may_return_null=1:"
|
||||
@ -9,7 +12,7 @@ EXT_FUNC_IMPL(__asan_default_options, const char*, (), false) {
|
||||
"handle_sigfpe=0:handle_sigill=0";
|
||||
}
|
||||
|
||||
EXT_FUNC_IMPL(__ubsan_default_options, const char*, (), false) {
|
||||
const char* __ubsan_default_options() {
|
||||
return "abort_on_error=1:"
|
||||
"allocator_release_to_os_interval_ms=500:"
|
||||
"handle_abort=0:handle_segv=0:"
|
||||
@ -17,4 +20,4 @@ EXT_FUNC_IMPL(__ubsan_default_options, const char*, (), false) {
|
||||
"handle_sigill=0:print_stacktrace=0:"
|
||||
"symbolize=0:symbolize_inline_frames=0";
|
||||
}
|
||||
|
||||
#endif // DEFAULT_SANITIZERS_OPTIONS
|
||||
|
Loading…
x
Reference in New Issue
Block a user