diff options
Diffstat (limited to 'projects/golang/build.sh')
-rwxr-xr-x | projects/golang/build.sh | 66 |
1 files changed, 31 insertions, 35 deletions
diff --git a/projects/golang/build.sh b/projects/golang/build.sh index 064378aa5..99868c4ca 100755 --- a/projects/golang/build.sh +++ b/projects/golang/build.sh @@ -12,41 +12,37 @@ # See the License for the specific language governing permissions and # limitations under the License. -function compile_fuzzer { - fuzzer=$(basename $1) +# These two dependencies cause build issues and are not used by oss-fuzz: +rm -r sqlparser +rm -r parser - compile_go_fuzzer "github.com/dvyukov/go-fuzz-corpus/$fuzzer" Fuzz $fuzzer +mkdir math && cp $SRC/math_big_fuzzer.go ./math/ - # Pack the seed corpus - zip -r $OUT/fuzzer-${fuzzer}_seed_corpus.zip \ - $GOPATH/src/github.com/dvyukov/go-fuzz-corpus/$fuzzer/corpus -} - -export -f compile_fuzzer - -# Use this to attempt to compile all -#find $SRC/go-fuzz-corpus -mindepth 1 -maxdepth 1 -type d -exec bash -c 'compile_fuzzer "$@"' bash {} \; - -compile_fuzzer asn1 -#compile_fuzzer bzip2 -compile_fuzzer csv -compile_fuzzer elliptic -compile_fuzzer flate -compile_fuzzer fmt -#compile_fuzzer gif -compile_fuzzer gzip -compile_fuzzer httpreq -compile_fuzzer httpresp -compile_fuzzer jpeg -compile_fuzzer json -compile_fuzzer lzw -compile_fuzzer mime -compile_fuzzer multipart -compile_fuzzer png -compile_fuzzer tar -compile_fuzzer time -#compile_fuzzer url -compile_fuzzer xml -compile_fuzzer zip -compile_fuzzer zlib +go get -u golang.org/x/text +mkdir text && cp $SRC/text_fuzzer.go ./text/ +go mod init "github.com/dvyukov/go-fuzz-corpus" +export FUZZ_ROOT="github.com/dvyukov/go-fuzz-corpus" +compile_go_fuzzer $FUZZ_ROOT/text FuzzAcceptLanguage accept_language_fuzzer +compile_go_fuzzer $FUZZ_ROOT/text FuzzCurrency currency_fuzzer +compile_go_fuzzer $FUZZ_ROOT/math FuzzBigIntCmp1 big_cmp_fuzzer1 +compile_go_fuzzer $FUZZ_ROOT/math FuzzBigIntCmp2 big_cmp_fuzzer2 +compile_go_fuzzer $FUZZ_ROOT/math FuzzRatSetString big_rat_fuzzer +compile_go_fuzzer $FUZZ_ROOT/asn1 Fuzz asn_fuzzer +compile_go_fuzzer $FUZZ_ROOT/csv Fuzz csv_fuzzer +compile_go_fuzzer $FUZZ_ROOT/elliptic Fuzz elliptic_fuzzer +compile_go_fuzzer $FUZZ_ROOT/flate Fuzz flate_fuzzer +compile_go_fuzzer $FUZZ_ROOT/fmt Fuzz fmt_fuzzer +compile_go_fuzzer $FUZZ_ROOT/gzip Fuzz gzip_fuzzer +compile_go_fuzzer $FUZZ_ROOT/httpreq Fuzz httpreq_fuzzer +compile_go_fuzzer $FUZZ_ROOT/jpeg Fuzz jpeg_fuzzer +compile_go_fuzzer $FUZZ_ROOT/json Fuzz json_fuzzer +compile_go_fuzzer $FUZZ_ROOT/lzw Fuzz lzw_fuzzer +compile_go_fuzzer $FUZZ_ROOT/mime Fuzz mime_fuzzer +compile_go_fuzzer $FUZZ_ROOT/multipart Fuzz multipart_fuzzer +compile_go_fuzzer $FUZZ_ROOT/png Fuzz png_fuzzer +compile_go_fuzzer $FUZZ_ROOT/tar Fuzz tar_fuzzer +compile_go_fuzzer $FUZZ_ROOT/time Fuzz time_fuzzer +compile_go_fuzzer $FUZZ_ROOT/xml Fuzz xml_fuzzer +compile_go_fuzzer $FUZZ_ROOT/zip Fuzz zip_fuzzer +compile_go_fuzzer $FUZZ_ROOT/zlib Fuzz zlib_fuzzer |