mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-16 03:48:08 +00:00
android: Fix runtime for mutator
This commit is contained in:
@ -135,6 +135,8 @@ cc_binary_host {
|
|||||||
"-DCLANGPP_BIN=\"prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++\"",
|
"-DCLANGPP_BIN=\"prebuilts/clang/host/linux-x86/clang-r383902b/bin/clang++\"",
|
||||||
"-DAFL_REAL_LD=\"prebuilts/clang/host/linux-x86/clang-r383902b/bin/ld.lld\"",
|
"-DAFL_REAL_LD=\"prebuilts/clang/host/linux-x86/clang-r383902b/bin/ld.lld\"",
|
||||||
"-DLLVM_LTO=1",
|
"-DLLVM_LTO=1",
|
||||||
|
"-DLLVM_MAJOR=11",
|
||||||
|
"-DLLVM_MINOR=2",
|
||||||
],
|
],
|
||||||
|
|
||||||
srcs: [
|
srcs: [
|
||||||
@ -145,8 +147,6 @@ cc_binary_host {
|
|||||||
symlinks: [
|
symlinks: [
|
||||||
"afl-clang-fast",
|
"afl-clang-fast",
|
||||||
"afl-clang-fast++",
|
"afl-clang-fast++",
|
||||||
"afl-clang-lto",
|
|
||||||
"afl-clang-lto++",
|
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
14
src/afl-cc.c
14
src/afl-cc.c
@ -586,6 +586,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
if (instrument_mode == INSTRUMENT_PCGUARD) {
|
if (instrument_mode == INSTRUMENT_PCGUARD) {
|
||||||
|
|
||||||
#if LLVM_MAJOR > 10 || (LLVM_MAJOR == 10 && LLVM_MINOR > 0)
|
#if LLVM_MAJOR > 10 || (LLVM_MAJOR == 10 && LLVM_MINOR > 0)
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
|
||||||
|
#else
|
||||||
if (have_instr_list) {
|
if (have_instr_list) {
|
||||||
|
|
||||||
if (!be_quiet)
|
if (!be_quiet)
|
||||||
@ -605,6 +608,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#if LLVM_MAJOR >= 4
|
#if LLVM_MAJOR >= 4
|
||||||
if (!be_quiet)
|
if (!be_quiet)
|
||||||
@ -1034,6 +1038,10 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __ANDROID__
|
||||||
|
have_llvm = 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
if ((ptr = find_object("afl-gcc-pass.so", argv[0])) != NULL) {
|
if ((ptr = find_object("afl-gcc-pass.so", argv[0])) != NULL) {
|
||||||
|
|
||||||
have_gcc_plugin = 1;
|
have_gcc_plugin = 1;
|
||||||
@ -1807,11 +1815,8 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
if (!be_quiet && cmplog_mode)
|
if (!be_quiet && cmplog_mode)
|
||||||
printf("CmpLog mode by <andreafioraldi@gmail.com>\n");
|
printf("CmpLog mode by <andreafioraldi@gmail.com>\n");
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifndef __ANDROID__
|
||||||
ptr = find_object("afl-compiler-rt.so", argv[0]);
|
|
||||||
#else
|
|
||||||
ptr = find_object("afl-compiler-rt.o", argv[0]);
|
ptr = find_object("afl-compiler-rt.o", argv[0]);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!ptr) {
|
if (!ptr) {
|
||||||
|
|
||||||
@ -1824,6 +1829,7 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
if (debug) { DEBUGF("rt=%s obj_path=%s\n", ptr, obj_path); }
|
if (debug) { DEBUGF("rt=%s obj_path=%s\n", ptr, obj_path); }
|
||||||
|
|
||||||
ck_free(ptr);
|
ck_free(ptr);
|
||||||
|
#endif
|
||||||
|
|
||||||
edit_params(argc, argv, envp);
|
edit_params(argc, argv, envp);
|
||||||
|
|
||||||
|
@ -141,7 +141,10 @@ struct custom_mutator *load_custom_mutator(afl_state_t *afl, const char *fn) {
|
|||||||
struct custom_mutator *mutator = ck_alloc(sizeof(struct custom_mutator));
|
struct custom_mutator *mutator = ck_alloc(sizeof(struct custom_mutator));
|
||||||
|
|
||||||
mutator->name = fn;
|
mutator->name = fn;
|
||||||
mutator->name_short = strrchr(fn, '/') + 1;
|
if (memchr(fn, '/', strlen(fn)))
|
||||||
|
mutator->name_short = strrchr(fn, '/') + 1;
|
||||||
|
else
|
||||||
|
mutator->name_short = strdup(fn);
|
||||||
ACTF("Loading custom mutator library from '%s'...", fn);
|
ACTF("Loading custom mutator library from '%s'...", fn);
|
||||||
|
|
||||||
dh = dlopen(fn, RTLD_NOW);
|
dh = dlopen(fn, RTLD_NOW);
|
||||||
|
Reference in New Issue
Block a user