mirror of https://github.com/google/oss-fuzz.git
libarchive: fix xenial build to latest base (#6441)
* libarchive: fix xenial build to latest base * libarchive: switch to cmake build
This commit is contained in:
parent
3341d86a1e
commit
1194a4d59c
|
@ -14,18 +14,14 @@
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Using Ubuntu 16.04 because of breakage on Ubuntu 20.04.
|
FROM gcr.io/oss-fuzz-base/base-builder
|
||||||
# See https://github.com/google/oss-fuzz/issues/6291 for more details.
|
|
||||||
FROM gcr.io/oss-fuzz-base/base-builder:xenial
|
|
||||||
# Delete line above and uncomment line below to upgrade to 20.04.
|
|
||||||
# FROM gcr.io/oss-fuzz-base/base-builder
|
|
||||||
|
|
||||||
# Installing optional libraries can utilize more code path and/or improve
|
|
||||||
# performance (avoid calling external programs).
|
|
||||||
RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config \
|
RUN apt-get update && apt-get install -y make autoconf automake libtool pkg-config \
|
||||||
libbz2-dev liblzo2-dev liblzma-dev liblz4-dev libz-dev \
|
libbz2-dev liblzo2-dev liblzma-dev liblz4-dev libz-dev \
|
||||||
libxml2-dev libssl-dev libacl1-dev libattr1-dev lrzip \
|
libssl-dev libacl1-dev libattr1-dev lrzip \
|
||||||
liblz4-tool lzop zstd lcab genisoimage jlha-utils rar default-jdk
|
liblz4-tool lzop zstd lcab genisoimage jlha-utils rar default-jdk
|
||||||
RUN git clone --depth 1 https://github.com/libarchive/libarchive.git
|
RUN git clone --depth 1 https://github.com/libarchive/libarchive.git
|
||||||
WORKDIR libarchive
|
RUN git clone --depth 1 https://gitlab.gnome.org/GNOME/libxml2.git
|
||||||
|
|
||||||
COPY build.sh libarchive_fuzzer.cc $SRC/
|
COPY build.sh libarchive_fuzzer.cc $SRC/
|
||||||
|
WORKDIR $SRC
|
||||||
|
|
|
@ -15,18 +15,35 @@
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# build the project
|
# compile libxml2 from source so we can statically link
|
||||||
./build/autogen.sh
|
DEPS=/deps
|
||||||
./configure
|
mkdir ${DEPS}
|
||||||
make -j$(nproc) all
|
cd $SRC/libxml2
|
||||||
|
./autogen.sh \
|
||||||
|
--without-debug \
|
||||||
|
--without-ftp \
|
||||||
|
--without-http \
|
||||||
|
--without-legacy \
|
||||||
|
--without-python
|
||||||
|
make -j$(nproc)
|
||||||
|
make install
|
||||||
|
cp .libs/libxml2.a ${DEPS}/
|
||||||
|
cd $SRC/libarchive
|
||||||
|
|
||||||
|
sed -i 's/-Wall//g' ./CMakeLists.txt
|
||||||
|
sed -i 's/-Werror//g' ./CMakeLists.txt
|
||||||
|
|
||||||
|
mkdir build2
|
||||||
|
cd build2
|
||||||
|
cmake ../
|
||||||
|
make
|
||||||
|
|
||||||
# build seed
|
# build seed
|
||||||
cp $SRC/libarchive/contrib/oss-fuzz/corpus.zip\
|
cp $SRC/libarchive/contrib/oss-fuzz/corpus.zip\
|
||||||
$OUT/libarchive_fuzzer_seed_corpus.zip
|
$OUT/libarchive_fuzzer_seed_corpus.zip
|
||||||
|
|
||||||
# build fuzzer(s)
|
# build fuzzer(s)
|
||||||
$CXX $CXXFLAGS -Ilibarchive \
|
$CXX $CXXFLAGS -I../libarchive \
|
||||||
$SRC/libarchive_fuzzer.cc -o $OUT/libarchive_fuzzer \
|
$SRC/libarchive_fuzzer.cc -o $OUT/libarchive_fuzzer \
|
||||||
$LIB_FUZZING_ENGINE .libs/libarchive.a \
|
$LIB_FUZZING_ENGINE ./libarchive/libarchive.a \
|
||||||
-Wl,-Bstatic -lbz2 -llzo2 -lxml2 -llzma -lz -lcrypto -llz4 -licuuc \
|
-lcrypto -lacl -llzma -llz4 -lbz2 -lz ${DEPS}/libxml2.a
|
||||||
-licudata -Wl,-Bdynamic
|
|
||||||
|
|
Loading…
Reference in New Issue