mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-18 04:38:08 +00:00
Add an env to afl-clang-fast to disable setting rpath if LLVM path isn't
recognized
This commit is contained in:
@ -135,6 +135,12 @@ subset of the settings discussed in section 1, with the exception of:
|
|||||||
- `TMPDIR` and `AFL_KEEP_ASSEMBLY`, since no temporary assembly files are
|
- `TMPDIR` and `AFL_KEEP_ASSEMBLY`, since no temporary assembly files are
|
||||||
created.
|
created.
|
||||||
|
|
||||||
|
- LLVM modes compiling C++ will normally set rpath in the binary if LLVM is
|
||||||
|
not in a usual location (/usr or /lib). Setting `AFL_LLVM_NO_RPATH=1`
|
||||||
|
disables this behaviour in case it isn't desired. For example, the compiling
|
||||||
|
toolchain might be in a custom location, but the target machine has LLVM
|
||||||
|
runtime libs in the search path.
|
||||||
|
|
||||||
Then there are a few specific features that are only available in
|
Then there are a few specific features that are only available in
|
||||||
instrumentation mode:
|
instrumentation mode:
|
||||||
|
|
||||||
|
@ -162,6 +162,7 @@ static char *afl_environment_variables[] = {
|
|||||||
"AFL_LLVM_MAP_DYNAMIC",
|
"AFL_LLVM_MAP_DYNAMIC",
|
||||||
"AFL_LLVM_NGRAM_SIZE",
|
"AFL_LLVM_NGRAM_SIZE",
|
||||||
"AFL_NGRAM_SIZE",
|
"AFL_NGRAM_SIZE",
|
||||||
|
"AFL_LLVM_NO_RPATH",
|
||||||
"AFL_LLVM_NOT_ZERO",
|
"AFL_LLVM_NOT_ZERO",
|
||||||
"AFL_LLVM_INSTRUMENT_FILE",
|
"AFL_LLVM_INSTRUMENT_FILE",
|
||||||
"AFL_LLVM_THREADSAFE_INST",
|
"AFL_LLVM_THREADSAFE_INST",
|
||||||
|
@ -1144,6 +1144,7 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
if (!have_pic) { cc_params[cc_par_cnt++] = "-fPIC"; }
|
if (!have_pic) { cc_params[cc_par_cnt++] = "-fPIC"; }
|
||||||
|
|
||||||
|
if (!getenv("AFL_LLVM_NO_RPATH")) {
|
||||||
// in case LLVM is installed not via a package manager or "make install"
|
// in case LLVM is installed not via a package manager or "make install"
|
||||||
// e.g. compiled download or compiled from github then its ./lib directory
|
// e.g. compiled download or compiled from github then its ./lib directory
|
||||||
// might not be in the search path. Add it if so.
|
// might not be in the search path. Add it if so.
|
||||||
@ -1160,6 +1161,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if (getenv("AFL_HARDEN")) {
|
if (getenv("AFL_HARDEN")) {
|
||||||
|
|
||||||
cc_params[cc_par_cnt++] = "-fstack-protector-all";
|
cc_params[cc_par_cnt++] = "-fstack-protector-all";
|
||||||
@ -2289,7 +2292,9 @@ int main(int argc, char **argv, char **envp) {
|
|||||||
" AFL_LLVM_CTX: use full context sensitive coverage (for "
|
" AFL_LLVM_CTX: use full context sensitive coverage (for "
|
||||||
"CLASSIC)\n"
|
"CLASSIC)\n"
|
||||||
" AFL_LLVM_NGRAM_SIZE: use ngram prev_loc count coverage (for "
|
" AFL_LLVM_NGRAM_SIZE: use ngram prev_loc count coverage (for "
|
||||||
"CLASSIC)\n");
|
"CLASSIC)\n"
|
||||||
|
" AFL_LLVM_NO_RPATH: disable rpath setting for custom LLVM "
|
||||||
|
"locations\n");
|
||||||
|
|
||||||
#ifdef AFL_CLANG_FLTO
|
#ifdef AFL_CLANG_FLTO
|
||||||
if (have_lto)
|
if (have_lto)
|
||||||
|
Reference in New Issue
Block a user