Skip to content

How to make libfuzzer oniguruma program on Linux

K.Kosako edited this page Jun 30, 2017 · 2 revisions

Install Clang 5.0

Install fuzzer library

$ cd build/lib
$ sudo cp libLLVMFuzzerNoMain.a /usr/local/lib/libLLVMFuzzer.a
$ sudo cp libLLVMFuzzer.a /usr/local/lib/libLLVMFuzzerMain.a

Make libfuzzer-onig

$ cd oniguruma
$ ./configure CC=clang LD=clang CFLAGS="-g -fsanitize=fuzzer,address" LDFLAGS="-fsanitize-coverage=trace-pc-guard -fsanitize=fuzzer,address"
$ make

$ cd contributed
$ clang++ libfuzzer-onig.cpp ../src/.libs/libonig.a /usr/local/lib/libLLVMFuzzerMain.a -o libfuzzer-onig -fsanitize-coverage=trace-pc-guard -fsanitize=fuzzer,address

Run

$ mkdir in
$ ./libffuzer-onig in