aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/oss-fuzz/oss-fuzz-build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/oss-fuzz/oss-fuzz-build.sh')
-rwxr-xr-xcontrib/oss-fuzz/oss-fuzz-build.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/oss-fuzz/oss-fuzz-build.sh b/contrib/oss-fuzz/oss-fuzz-build.sh
new file mode 100755
index 000000000000..83d8470b13f3
--- /dev/null
+++ b/contrib/oss-fuzz/oss-fuzz-build.sh
@@ -0,0 +1,16 @@
+# build the project
+./build/autogen.sh
+./configure
+make -j$(nproc) all
+
+# build seed
+cp $SRC/libarchive/contrib/oss-fuzz/corpus.zip\
+ $OUT/libarchive_fuzzer_seed_corpus.zip
+
+# build fuzzer(s)
+$CXX $CXXFLAGS -Ilibarchive \
+ $SRC/libarchive/contrib/oss-fuzz/libarchive_fuzzer.cc \
+ -o $OUT/libarchive_fuzzer $LIB_FUZZING_ENGINE \
+ .libs/libarchive.a -Wl,-Bstatic -lbz2 -llzo2 \
+ -lxml2 -llzma -lz -lcrypto -llz4 -licuuc \
+ -licudata -Wl,-Bdynamic