doc, code format

This commit is contained in:
vanhauser-thc 2023-04-28 11:42:21 +02:00
parent e956f23a77
commit 5813a4319c
4 changed files with 36 additions and 22 deletions

View File

@ -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

View File

@ -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`

View File

@ -753,14 +753,20 @@ static void edit_params(u32 argc, char **argv, char **envp) {
#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,15 +1666,19 @@ 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 ||
strncasecmp(ptr2, "pcguard", strlen("pcguard")) == 0) { strncasecmp(ptr2, "pcguard", strlen("pcguard")) == 0) {
@ -1695,14 +1705,19 @@ 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 ||
strncasecmp(ptr2, "instrim", strlen("instrim")) == 0) { strncasecmp(ptr2, "instrim", strlen("instrim")) == 0) {