aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2021-12-08 11:28:33 +0100
committervanhauser-thc <vh@thc.org>2021-12-08 11:28:41 +0100
commite46adb0be7c5e1a0a1d49723678a9df20dfbe400 (patch)
treec9da73108a4ab6288afe4f4ba95b2a6d6590c654
parent1f6c72ea1baea69b2dc5b3a68bfacbc00652bc66 (diff)
downloadafl++-e46adb0be7c5e1a0a1d49723678a9df20dfbe400.tar.gz
fix AFL_REAL_LD for afl-cc
-rw-r--r--docs/Changelog.md1
-rw-r--r--src/afl-cc.c3
2 files changed, 3 insertions, 1 deletions
diff --git a/docs/Changelog.md b/docs/Changelog.md
index be5cac43..34b9affb 100644
--- a/docs/Changelog.md
+++ b/docs/Changelog.md
@@ -48,6 +48,7 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
- fixed a potential crash in targets for LAF string handling
- added AFL_USE_TSAN thread sanitizer support
- llvm and LTO mode modified to work with new llvm 14-dev (again)
+ - fix for AFL_REAL_LD
- added the very good grammar mutator "GramaTron" to the
custom_mutators
- added optimin, a faster and better corpus minimizer by
diff --git a/src/afl-cc.c b/src/afl-cc.c
index 6bdb9572..1448d8ae 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -555,7 +555,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (lto_mode && !have_c) {
- u8 *ld_path = strdup(AFL_REAL_LD);
+ u8 *ld_path = NULL;
+ if (getenv("AFL_REAL_LD")) { ld_path = strdup(getenv("AFL_REAL_LD")); }
if (!ld_path || !*ld_path) { ld_path = strdup("ld.lld"); }
if (!ld_path) { PFATAL("Could not allocate mem for ld_path"); }
#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 12