fix split pass loading

This commit is contained in:
vanhauser-thc
2022-03-18 08:47:45 +01:00
parent 90fd61d14a
commit bdfac291ba
2 changed files with 19 additions and 2 deletions

View File

@ -24,6 +24,8 @@ sending a mail to <afl-users+subscribe@googlegroups.com>.
possible in the target (for afl-gcc-fast/afl-clang-fast/ possible in the target (for afl-gcc-fast/afl-clang-fast/
afl-clang-lto) afl-clang-lto)
- afl-cc: - 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+ - converted all passed to use the new llvm pass manager for llvm 11+
- frida_mode: - frida_mode:
- update to new frida release, handles now c++ throw/catch - update to new frida release, handles now c++ throw/catch

View File

@ -526,11 +526,17 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} else { } 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++] = "-Xclang";
cc_params[cc_par_cnt++] = "-load"; cc_params[cc_par_cnt++] = "-load";
cc_params[cc_par_cnt++] = "-Xclang"; cc_params[cc_par_cnt++] = "-Xclang";
cc_params[cc_par_cnt++] = cc_params[cc_par_cnt++] =
alloc_printf("%s/split-compares-pass.so", obj_path); 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 { } 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++] = "-Xclang";
cc_params[cc_par_cnt++] = "-load"; cc_params[cc_par_cnt++] = "-load";
cc_params[cc_par_cnt++] = "-Xclang"; 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++] = "-Xclang";
cc_params[cc_par_cnt++] = cc_params[cc_par_cnt++] =
alloc_printf("%s/split-switches-pass.so", obj_path); alloc_printf("%s/split-switches-pass.so", obj_path);
#endif
} }
cc_params[cc_par_cnt++] = "-fno-inline";
} }
//#if LLVM_MAJOR >= 13 //#if LLVM_MAJOR >= 13