aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorvanhauser-thc <vh@thc.org>2022-03-17 14:35:15 +0100
committervanhauser-thc <vh@thc.org>2022-03-17 14:35:15 +0100
commite4f201707fdfbf9a36b6a48c16f75b0fef2c9e75 (patch)
tree3d2622f4eabd0dc5abb0748d190722441df3fb47 /src
parent59eaed2f70cd495092d747fd872d429e14f4d6a9 (diff)
downloadAFLplusplus-e4f201707fdfbf9a36b6a48c16f75b0fef2c9e75.tar.gz
make LTO pass work too plus some fixes
Diffstat (limited to 'src')
-rw-r--r--src/afl-cc.c3
-rw-r--r--src/afl-ld-lto.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c
index a7248325..4c977303 100644
--- a/src/afl-cc.c
+++ b/src/afl-cc.c
@@ -599,6 +599,9 @@ static void edit_params(u32 argc, char **argv, char **envp) {
free(ld_path);
cc_params[cc_par_cnt++] = "-Wl,--allow-multiple-definition";
+#if defined(AFL_CLANG_LDPATH) && LLVM_MAJOR >= 15
+ cc_params[cc_par_cnt++] = "-Wl,--lto-legacy-pass-manager";
+#endif
cc_params[cc_par_cnt++] =
alloc_printf("-Wl,-mllvm=-load=%s/SanitizerCoverageLTO.so", obj_path);
cc_params[cc_par_cnt++] = lto_flag;
diff --git a/src/afl-ld-lto.c b/src/afl-ld-lto.c
index 9b58125f..f2f95fd7 100644
--- a/src/afl-ld-lto.c
+++ b/src/afl-ld-lto.c
@@ -86,7 +86,7 @@ static void edit_params(int argc, char **argv) {
for (i = 1; i < (u32)argc; i++) {
if (strstr(argv[i], "/afl-llvm-rt-lto.o") != NULL) rt_lto_present = 1;
- if (strstr(argv[i], "/afl-llvm-rt.o") != NULL) rt_present = 1;
+ if (strstr(argv[i], "/afl-compiler-rt.o") != NULL) rt_present = 1;
if (strstr(argv[i], "/afl-llvm-lto-instr") != NULL) inst_present = 1;
}
@@ -237,7 +237,7 @@ static void edit_params(int argc, char **argv) {
}
if (!rt_present)
- ld_params[ld_param_cnt++] = alloc_printf("%s/afl-llvm-rt.o", afl_path);
+ ld_params[ld_param_cnt++] = alloc_printf("%s/afl-compiler-rt.o", afl_path);
if (!rt_lto_present)
ld_params[ld_param_cnt++] =
alloc_printf("%s/afl-llvm-rt-lto.o", afl_path);