我正在尝试在macOS 10.14.6和CLion 2019.2.5上编译一个简单的模糊测试示例
#include <stdint.h>
#include <stddef.h>
extern "C" int LLVMfuzzerTestOneInput(const uint8_t *data,size_t size) {
if (size > 0 && data[0] == 'H')
if (size > 1 && data[1] == 'I')
if (size > 2 && data[2] == '!')
__builtin_trap();
return 0;
}
这里也显示https://llvm.org/docs/LibFuzzer.html#toy-example,如果已经设置了我的CMakeLists.txt,那么一切正常,他会在发生错误后链接CXX可执行文件
Undefined symbols for architecture x86_64:
"_main",referenced from:
implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
当我通过终端用Ubuntu 18.04的Virtualbox尝试编译时发生相同的错误-相同的Clion版本和Cmakelist没问题