add CFI variant for gcc

This commit is contained in:
vanhauser-thc
2023-01-23 12:45:21 +01:00
parent 5163a49350
commit 8bc7b3cf26

View File

@ -1050,6 +1050,12 @@ static void edit_params(u32 argc, char **argv, char **envp) {
if (getenv("AFL_USE_CFISAN")) { if (getenv("AFL_USE_CFISAN")) {
if (compiler_mode == GCC_PLUGIN || compiler_mode == GCC) {
cc_params[cc_par_cnt++] = "-fcf-protection";
} else {
if (!lto_mode) { if (!lto_mode) {
uint32_t i = 0, found = 0; uint32_t i = 0, found = 0;
@ -1064,6 +1070,8 @@ static void edit_params(u32 argc, char **argv, char **envp) {
} }
}
if (!getenv("AFL_DONT_OPTIMIZE")) { if (!getenv("AFL_DONT_OPTIMIZE")) {
cc_params[cc_par_cnt++] = "-g"; cc_params[cc_par_cnt++] = "-g";