diff options
author | van Hauser <vh@thc.org> | 2023-01-27 13:40:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-27 13:40:48 +0100 |
commit | 4a54555a1a73dd6be4f494ef67155ed41a81f0f4 (patch) | |
tree | dc29dd420c9d1d0f071447c91c0a0ab85780ad05 /src/afl-cc.c | |
parent | 1b4e1d75b32c6024765ab27b36591ae97cb33f6b (diff) | |
parent | 33eba1fc5652060e8d877b02135fce2325813d0c (diff) | |
download | afl++-4a54555a1a73dd6be4f494ef67155ed41a81f0f4.tar.gz |
Merge pull request #1628 from AFLplusplus/dev
Dev
Diffstat (limited to 'src/afl-cc.c')
-rw-r--r-- | src/afl-cc.c | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/afl-cc.c b/src/afl-cc.c index 803e784e..7c3682fb 100644 --- a/src/afl-cc.c +++ b/src/afl-cc.c @@ -1050,17 +1050,25 @@ static void edit_params(u32 argc, char **argv, char **envp) { if (getenv("AFL_USE_CFISAN")) { - if (!lto_mode) { + if (compiler_mode == GCC_PLUGIN || compiler_mode == GCC) { - uint32_t i = 0, found = 0; - while (envp[i] != NULL && !found) - if (strncmp("-flto", envp[i++], 5) == 0) found = 1; - if (!found) cc_params[cc_par_cnt++] = "-flto"; + cc_params[cc_par_cnt++] = "-fcf-protection=full"; - } + } else { + + if (!lto_mode) { + + uint32_t i = 0, found = 0; + while (envp[i] != NULL && !found) + if (strncmp("-flto", envp[i++], 5) == 0) found = 1; + if (!found) cc_params[cc_par_cnt++] = "-flto"; - cc_params[cc_par_cnt++] = "-fsanitize=cfi"; - cc_params[cc_par_cnt++] = "-fvisibility=hidden"; + } + + cc_params[cc_par_cnt++] = "-fsanitize=cfi"; + cc_params[cc_par_cnt++] = "-fvisibility=hidden"; + + } } |