mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 01:01:33 +00:00
doc, code format
This commit is contained in:
parent
e956f23a77
commit
5813a4319c
@ -379,6 +379,7 @@ help:
|
|||||||
@echo Known build environment options:
|
@echo Known build environment options:
|
||||||
@echo "=========================================="
|
@echo "=========================================="
|
||||||
@echo STATIC - compile AFL++ static
|
@echo STATIC - compile AFL++ static
|
||||||
|
@echo CODE_COVERAGE - compile the target for code coverage (see docs/instrumentation/README.llvm.md)
|
||||||
@echo ASAN_BUILD - compiles AFL++ with memory sanitizer for debug purposes
|
@echo ASAN_BUILD - compiles AFL++ with memory sanitizer for debug purposes
|
||||||
@echo UBSAN_BUILD - compiles AFL++ tools with undefined behaviour sanitizer for debug purposes
|
@echo UBSAN_BUILD - compiles AFL++ tools with undefined behaviour sanitizer for debug purposes
|
||||||
@echo DEBUG - no optimization, -ggdb3, all warnings and -Werror
|
@echo DEBUG - no optimization, -ggdb3, all warnings and -Werror
|
||||||
@ -394,7 +395,7 @@ help:
|
|||||||
@echo AFL_NO_X86 - if compiling on non-intel/amd platforms
|
@echo AFL_NO_X86 - if compiling on non-intel/amd platforms
|
||||||
@echo "LLVM_CONFIG - if your distro doesn't use the standard name for llvm-config (e.g., Debian)"
|
@echo "LLVM_CONFIG - if your distro doesn't use the standard name for llvm-config (e.g., Debian)"
|
||||||
@echo "=========================================="
|
@echo "=========================================="
|
||||||
@echo e.g.: make ASAN_BUILD=1
|
@echo e.g.: make LLVM_CONFIG=llvm-config-16
|
||||||
|
|
||||||
.PHONY: test_x86
|
.PHONY: test_x86
|
||||||
ifndef AFL_NO_X86
|
ifndef AFL_NO_X86
|
||||||
|
@ -79,22 +79,20 @@ make STATIC=1
|
|||||||
These build options exist:
|
These build options exist:
|
||||||
|
|
||||||
* STATIC - compile AFL++ static
|
* STATIC - compile AFL++ static
|
||||||
|
* CODE_COVERAGE - compile the target for code coverage (see docs/instrumentation/README.llvm.md)
|
||||||
* ASAN_BUILD - compiles AFL++ with memory sanitizer for debug purposes
|
* ASAN_BUILD - compiles AFL++ with memory sanitizer for debug purposes
|
||||||
* UBSAN_BUILD - compiles AFL++ tools with undefined behaviour sanitizer for
|
* UBSAN_BUILD - compiles AFL++ tools with undefined behaviour sanitizer for debug purposes
|
||||||
debug purposes
|
|
||||||
* DEBUG - no optimization, -ggdb3, all warnings and -Werror
|
* DEBUG - no optimization, -ggdb3, all warnings and -Werror
|
||||||
* LLVM_DEBUG - shows llvm deprecation warnings
|
* LLVM_DEBUG - shows llvm deprecation warnings
|
||||||
* PROFILING - compile afl-fuzz with profiling information
|
* PROFILING - compile afl-fuzz with profiling information
|
||||||
* INTROSPECTION - compile afl-fuzz with mutation introspection
|
* INTROSPECTION - compile afl-fuzz with mutation introspection
|
||||||
* NO_PYTHON - disable python support
|
* NO_PYTHON - disable python support
|
||||||
* NO_SPLICING - disables splicing mutation in afl-fuzz, not recommended for
|
* NO_SPLICING - disables splicing mutation in afl-fuzz, not recommended for normal fuzzing
|
||||||
normal fuzzing
|
|
||||||
* NO_NYX - disable building nyx mode dependencies
|
* NO_NYX - disable building nyx mode dependencies
|
||||||
* NO_CORESIGHT - disable building coresight (arm64 only)
|
* NO_CORESIGHT - disable building coresight (arm64 only)
|
||||||
* NO_UNICORN_ARM64 - disable building unicorn on arm64
|
* NO_UNICORN_ARM64 - disable building unicorn on arm64
|
||||||
* AFL_NO_X86 - if compiling on non-intel/amd platforms
|
* AFL_NO_X86 - if compiling on non-intel/amd platforms
|
||||||
* LLVM_CONFIG - if your distro doesn't use the standard name for llvm-config
|
* LLVM_CONFIG - if your distro doesn't use the standard name for llvm-config (e.g., Debian)
|
||||||
(e.g., Debian)
|
|
||||||
|
|
||||||
e.g.: `make LLVM_CONFIG=llvm-config-14`
|
e.g.: `make LLVM_CONFIG=llvm-config-14`
|
||||||
|
|
||||||
|
@ -544,12 +544,12 @@ static void __afl_map_shm(void) {
|
|||||||
|
|
||||||
if (__afl_map_size && __afl_map_size > MAP_SIZE) {
|
if (__afl_map_size && __afl_map_size > MAP_SIZE) {
|
||||||
|
|
||||||
u8 *map_env = (u8 *)getenv("AFL_MAP_SIZE");
|
u8 *map_env = (u8 *)getenv("AFL_MAP_SIZE");
|
||||||
if (!map_env || atoi((char *)map_env) < MAP_SIZE) {
|
if (!map_env || atoi((char *)map_env) < MAP_SIZE) {
|
||||||
|
|
||||||
fprintf(stderr, "FS_ERROR_MAP_SIZE\n");
|
fprintf(stderr, "FS_ERROR_MAP_SIZE\n");
|
||||||
send_forkserver_error(FS_ERROR_MAP_SIZE);
|
send_forkserver_error(FS_ERROR_MAP_SIZE);
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -561,13 +561,13 @@ static void __afl_map_shm(void) {
|
|||||||
|
|
||||||
if (!__afl_area_ptr || __afl_area_ptr == (void *)-1) {
|
if (!__afl_area_ptr || __afl_area_ptr == (void *)-1) {
|
||||||
|
|
||||||
if (__afl_map_addr)
|
if (__afl_map_addr)
|
||||||
send_forkserver_error(FS_ERROR_MAP_ADDR);
|
send_forkserver_error(FS_ERROR_MAP_ADDR);
|
||||||
else
|
else
|
||||||
send_forkserver_error(FS_ERROR_SHMAT);
|
send_forkserver_error(FS_ERROR_SHMAT);
|
||||||
|
|
||||||
perror("shmat for map");
|
perror("shmat for map");
|
||||||
_exit(1);
|
_exit(1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
31
src/afl-cc.c
31
src/afl-cc.c
@ -752,15 +752,21 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
} else if (instrument_mode == INSTRUMENT_LLVMNATIVE) {
|
} else if (instrument_mode == INSTRUMENT_LLVMNATIVE) {
|
||||||
|
|
||||||
#if LLVM_MAJOR >= 4
|
#if LLVM_MAJOR >= 4
|
||||||
if (instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
|
if (instrument_opt_mode & INSTRUMENT_OPT_CODECOV) {
|
||||||
|
|
||||||
#if LLVM_MAJOR >= 6
|
#if LLVM_MAJOR >= 6
|
||||||
cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard,bb,no-prune,pc-table";
|
cc_params[cc_par_cnt++] =
|
||||||
|
"-fsanitize-coverage=trace-pc-guard,bb,no-prune,pc-table";
|
||||||
#else
|
#else
|
||||||
FATAL("pcguard instrumentation with pc-table requires llvm 6.0.1+");
|
FATAL("pcguard instrumentation with pc-table requires llvm 6.0.1+");
|
||||||
#endif
|
#endif
|
||||||
} else {
|
|
||||||
|
} else {
|
||||||
|
|
||||||
cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
|
cc_params[cc_par_cnt++] = "-fsanitize-coverage=trace-pc-guard";
|
||||||
}
|
|
||||||
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
FATAL("pcguard instrumentation requires llvm 4.0.1+");
|
FATAL("pcguard instrumentation requires llvm 4.0.1+");
|
||||||
#endif
|
#endif
|
||||||
@ -1660,13 +1666,17 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
instrument_mode = INSTRUMENT_CLASSIC;
|
instrument_mode = INSTRUMENT_CLASSIC;
|
||||||
lto_mode = 1;
|
lto_mode = 1;
|
||||||
|
|
||||||
} else if (!instrument_mode || instrument_mode == INSTRUMENT_AFL)
|
} else if (!instrument_mode || instrument_mode == INSTRUMENT_AFL) {
|
||||||
|
|
||||||
instrument_mode = INSTRUMENT_AFL;
|
instrument_mode = INSTRUMENT_AFL;
|
||||||
else
|
|
||||||
|
} else {
|
||||||
|
|
||||||
FATAL("main instrumentation mode already set with %s",
|
FATAL("main instrumentation mode already set with %s",
|
||||||
instrument_mode_string[instrument_mode]);
|
instrument_mode_string[instrument_mode]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncasecmp(ptr2, "pc-guard", strlen("pc-guard")) == 0 ||
|
if (strncasecmp(ptr2, "pc-guard", strlen("pc-guard")) == 0 ||
|
||||||
@ -1695,12 +1705,17 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
strncasecmp(ptr2, "llvm-codecov", strlen("llvm-codecov")) == 0) {
|
strncasecmp(ptr2, "llvm-codecov", strlen("llvm-codecov")) == 0) {
|
||||||
|
|
||||||
if (!instrument_mode || instrument_mode == INSTRUMENT_LLVMNATIVE) {
|
if (!instrument_mode || instrument_mode == INSTRUMENT_LLVMNATIVE) {
|
||||||
|
|
||||||
instrument_mode = INSTRUMENT_LLVMNATIVE;
|
instrument_mode = INSTRUMENT_LLVMNATIVE;
|
||||||
instrument_opt_mode |= INSTRUMENT_OPT_CODECOV;
|
instrument_opt_mode |= INSTRUMENT_OPT_CODECOV;
|
||||||
} else
|
|
||||||
|
} else {
|
||||||
|
|
||||||
FATAL("main instrumentation mode already set with %s",
|
FATAL("main instrumentation mode already set with %s",
|
||||||
instrument_mode_string[instrument_mode]);
|
instrument_mode_string[instrument_mode]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strncasecmp(ptr2, "cfg", strlen("cfg")) == 0 ||
|
if (strncasecmp(ptr2, "cfg", strlen("cfg")) == 0 ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user