fix split pass loading
MODIFY
docs/Changelog.md
docs/Changelog.md
@@ -24,6 +24,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
possible in the target (for afl-gcc-fast/afl-clang-fast/
afl-clang-lto)
- afl-cc:
+ ! llvm15-dev with LTO and extra features (LAF/CMPLOG etc.) might have
+ issues at the moment
- converted all passed to use the new llvm pass manager for llvm 11+
- frida_mode:
- update to new frida release, handles now c++ throw/catch

MODIFY
src/afl-cc.c
src/afl-cc.c
@@ -526,11 +526,17 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} else {
+#if LLVM_MAJOR >= 11 /* use new pass manager */
+ cc_params[cc_par_cnt++] = "-fexperimental-new-pass-manager";
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-fpass-plugin=%s/split-compares-pass.so", obj_path);
+#else
cc_params[cc_par_cnt++] = "-Xclang";
cc_params[cc_par_cnt++] = "-load";
cc_params[cc_par_cnt++] = "-Xclang";
cc_params[cc_par_cnt++] =
alloc_printf("%s/split-compares-pass.so", obj_path);
+#endif
}
@@ -553,6 +559,16 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} else {
+ cc_params[cc_par_cnt++] = "-fno-inline";
+
+#if LLVM_MAJOR >= 11 /* use new pass manager */
+ cc_params[cc_par_cnt++] = "-fexperimental-new-pass-manager";
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-fpass-plugin=%s/cmplog-switches-pass.so", obj_path);
+ cc_params[cc_par_cnt++] = "-fexperimental-new-pass-manager";
+ cc_params[cc_par_cnt++] =
+ alloc_printf("-fpass-plugin=%s/split-switches-pass.so", obj_path);
+#else
cc_params[cc_par_cnt++] = "-Xclang";
cc_params[cc_par_cnt++] = "-load";
cc_params[cc_par_cnt++] = "-Xclang";
@@ -565,11 +581,10 @@ static void edit_params(u32 argc, char **argv, char **envp) {
cc_params[cc_par_cnt++] = "-Xclang";
cc_params[cc_par_cnt++] =
alloc_printf("%s/split-switches-pass.so", obj_path);
+#endif
}
- cc_params[cc_par_cnt++] = "-fno-inline";
-
}
//#if LLVM_MAJOR >= 13

fix split pass loading