Skip to content

How to make libfuzzer oniguruma program on Mac OSX

K.Kosako edited this page Jun 30, 2017 · 1 revision
$ brew install --with-clang llvm

$ svn co http://llvm.org/svn/llvm-project/llvm/trunk/lib/Fuzzer
$ /usr/local/opt/llvm/bin/clang++ -c -g -O2 -std=c++11 Fuzzer/*.cpp -IFuzzer
$ ar ruv libFuzzer.a Fuzzer*.o
$ mv libFuzzer.a oniguruma

$ cd oniguruma
$ make clean
$ ./configure CC=/usr/local/opt/llvm/bin/clang CFLAGS="-g -fsanitize-coverage=edge\
 -fsanitize=address" LDFLAGS="-fsanitize-coverage=edge -fsanitize=address -L/us\
r/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

$ make

$ cp contributed/libfuzzer-onig.cpp .
$ /usr/local/opt/llvm/bin/clang++ -g libfuzzer-onig.cpp src/.libs/libonig.a libFuz\
zer.a -o libfuzzer-onig -fsanitize-coverage=edge -fsanitize=address

$ mkdir in
$ ./libfuzzer-onig in
$ mkdir	inXXX
$ ./libfuzzer-onig -timeout=20 -rss_limit_mb=4000 -max_len=XXX inXXX