Dear Maintainer,
In src/afl-cc.c, the compiler flag -fcf-protection is parsed as:
} else if (!strncmp(cur_argv, "-fcf-protection", strlen("-fcf-protection"))) {
SCAN_KEEP(aflcc->have_cfisan, 1);
This incorrectly records -fcf-protection as a CFISAN request, which injects -flto in clang mode and disables PCGUARD instrumentation. As a result, compiling targets with -fcf-protection (and self-tests on systems where -fcf-protection is enabled by default) breaks.
Upstream already addressed this in commit a9e8587ee86c8ff20a14de6aea6ec07d7d3f699f:
https://github.com/AFLplusplus/AFLplusplus/commit/a9e8587ee86c8ff20a14de6aea6ec07d7d3f699f
The backported patch is attached.