diff options
author | Dominik Maier <domenukk@gmail.com> | 2020-06-23 15:08:49 +0200 |
---|---|---|
committer | Dominik Maier <domenukk@gmail.com> | 2020-06-23 15:08:49 +0200 |
commit | aad433e11efa4a8350a264313c66db8ef6d17088 (patch) | |
tree | a8249027f61f17e259e4a4ef6f2339e0394b1e35 /llvm_mode/afl-clang-fast.c | |
parent | c1eb2bccaae8f5b31546e6af3b00583e46bd842b (diff) | |
parent | 59e1a18197b08b08ad9e75b23fb6a5c740a0b9dd (diff) | |
download | afl++-aad433e11efa4a8350a264313c66db8ef6d17088.tar.gz |
Merge branch 'dev' of github.com:vanhauser-thc/AFLplusplus into dev
Diffstat (limited to 'llvm_mode/afl-clang-fast.c')
-rw-r--r-- | llvm_mode/afl-clang-fast.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/llvm_mode/afl-clang-fast.c b/llvm_mode/afl-clang-fast.c index 75504ea5..3b0225c2 100644 --- a/llvm_mode/afl-clang-fast.c +++ b/llvm_mode/afl-clang-fast.c @@ -39,6 +39,8 @@ #include <limits.h> #include <assert.h> +#include "llvm/Config/llvm-config.h" + static u8 * obj_path; /* Path to runtime libraries */ static u8 **cc_params; /* Parameters passed to the real CC */ static u32 cc_par_cnt = 1; /* Param count, including argv0 */ @@ -464,7 +466,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 @@ -500,7 +502,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))"; @@ -757,12 +759,14 @@ int main(int argc, char **argv, char **envp) { if (instrument_mode == 0) { -#ifndef USE_TRACE_PC +#if LLVM_VERSION_MAJOR <= 6 + instrument_mode = INSTRUMENT_AFL; +#else if (getenv("AFL_LLVM_WHITELIST")) instrument_mode = INSTRUMENT_AFL; else -#endif instrument_mode = INSTRUMENT_PCGUARD; +#endif } |