clang 9 libfuzzer ——poppler 插桩

add_executable(libfuzzer_link_test libfuzzer_link_test.cpp)

target_compile_options(libfuzzer_link_test
        PRIVATE $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer,address -fsanitize-coverage=pc-table>
        )

target_link_libraries(libfuzzer_link_test
        PRIVATE $<$<C_COMPILER_ID:Clang>:-fsanitize=fuzzer,address>
        )
#!/bin/bash
rm -rf build
mkdir build
cd build
cmake .. \
        -DCMAKE_CXX_COMPILER=/home/hauly/tools/clang/current_clang/bin/clang++ \
        -DCMAKE_C_COMPILER=/home/hauly/tools/clang/current_clang/bin/clang \
        -DCMAKE_C_FLAGS="-fsanitize=address -fsanitize-coverage=inline-8bit-counters,trace-cmp,pc-table" \
        -DCMAKE_CXX_FLAGS="-fsanitize=address -fsanitize-coverage=inline-8bit-counters,trace-cmp,pc-table"
make -j8

推荐阅读更多精彩内容