From 67d87dd2a9dbc393b56162e77ff3178f4e3f59fa Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sun, 14 Jun 2020 15:26:43 +0000 Subject: Porting to Haiku. getrusage does not implement resident memory gathering, no shm api neither. --- llvm_mode/afl-clang-fast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm_mode/afl-clang-fast.c') diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 75504ea5..57504e65 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -464,7 +464,7 @@ static void edit_params(u32 argc, char **argv, char **envp) { } -#ifdef USEMMAP +#if defined(USEMMAP) && !defined(__HAIKU__) cc_params[cc_par_cnt++] = "-lrt"; #endif -- cgit 1.4.1 From e5dcaa818e58eaa48c58865ae9f623c5a44989d7 Mon Sep 17 00:00:00 2001 From: van Hauser Date: Tue, 16 Jun 2020 15:59:09 +0200 Subject: set class afl instrumentation if llvm <= 6 --- docs/Changelog.md | 8 ++++---- llvm_mode/afl-clang-fast.c | 12 +++++++----- 2 files changed, 11 insertions(+), 9 deletions(-) (limited to 'llvm_mode/afl-clang-fast.c') diff --git a/docs/Changelog.md b/docs/Changelog.md index 21f79cda..efc18ab5 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -24,10 +24,10 @@ sending a mail to . - fix/update to MOpt (thanks to arnow117) - added MOpt dictionary support from repo - llvm_mode: - - the default instrumentation is now PCGUARD, as it is faster and provides - better coverage. The original afl instrumentation can be set via - AFL_LLVM_INSTRUMENT=AFL. This is automatically done when the WHITELIST - feature is used. + - the default instrumentation is now PCGUARD if the llvm version is >= 7, + as it is faster and provides better coverage. The original afl + instrumentation can be set via AFL_LLVM_INSTRUMENT=AFL. This is + automatically done when the WHITELIST feature is used. - some targets want a ld variant for LD that is not gcc/clang but ld, added afl-ld-lto to solve this - lowered minimum required llvm version to 3.4 (except LLVMInsTrim, which diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 57504e65..1e71a8d1 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -757,12 +757,14 @@ int main(int argc, char **argv, char **envp) { if (instrument_mode == 0) { -#ifndef USE_TRACE_PC - if (getenv("AFL_LLVM_WHITELIST")) - instrument_mode = INSTRUMENT_AFL; - else +#if LLVM_VERSION_MAJOR <= 6 + instrument_mode = INSTRUMENT_AFL; +#else + if (getenv("AFL_LLVM_WHITELIST")) + instrument_mode = INSTRUMENT_AFL; + else + instrument_mode = INSTRUMENT_PCGUARD; #endif - instrument_mode = INSTRUMENT_PCGUARD; } -- cgit 1.4.1 From 2e35326040791fa3e320dfe85efda5f8771bdd97 Mon Sep 17 00:00:00 2001 From: "julian.haerig" Date: Tue, 16 Jun 2020 18:04:38 +0200 Subject: Fixed missing cast in afl-clang-fast.c, which results in a compilation error when using __AFL_FUZZ_TESTCASE_BUF in a C++ target --- llvm_mode/afl-clang-fast.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm_mode/afl-clang-fast.c') diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 1e71a8d1..6604b57c 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -500,7 +500,7 @@ static void edit_params(u32 argc, char **argv, char **envp) { "unsigned char *__afl_fuzz_alt_ptr;"; cc_params[cc_par_cnt++] = "-D__AFL_FUZZ_TESTCASE_BUF=(__afl_fuzz_ptr ? __afl_fuzz_ptr : " - "(__afl_fuzz_alt_ptr = malloc(1 * 1024 * 1024)))"; + "(__afl_fuzz_alt_ptr = (unsigned char *) malloc(1 * 1024 * 1024)))"; cc_params[cc_par_cnt++] = "-D__AFL_FUZZ_TESTCASE_LEN=(__afl_fuzz_ptr ? *__afl_fuzz_len : read(0, " "__afl_fuzz_alt_ptr, 1 * 1024 * 1024))"; -- cgit 1.4.1