mirror of https://github.com/google/oss-fuzz.git
[open62541] simplify build script (#727)
* [open62541] Switch to master branch and use gmail address for cc author * [open62541] Simplify build script and move logic to cmake This makes continuous integration easier in open62541 and allows to test the fuzzing targets
This commit is contained in:
parent
2503085af9
commit
411ff5a0bd
|
@ -17,7 +17,7 @@
|
|||
FROM gcr.io/oss-fuzz-base/base-builder
|
||||
MAINTAINER git@s.profanter.me
|
||||
RUN apt-get update && apt-get install -y make cmake
|
||||
RUN git clone --depth 1 https://github.com/open62541/open62541.git -bfeature/fuzzing open62541
|
||||
RUN git clone --depth 1 https://github.com/open62541/open62541.git -bmaster open62541
|
||||
WORKDIR open62541
|
||||
RUN git submodule update --init --recursive
|
||||
COPY build.sh $SRC/
|
||||
|
|
|
@ -29,40 +29,14 @@ cd $WORK/open62541
|
|||
|
||||
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_ENABLE_AMALGAMATION=OFF \
|
||||
-DBUILD_SHARED_LIBS=OFF -DUA_BUILD_EXAMPLES=OFF -DUA_LOGLEVEL=600 \
|
||||
-DUA_ENABLE_DISCOVERY=ON -DUA_ENABLE_DISCOVERY_MULTICAST=ON \
|
||||
-DUA_BUILD_OSS_FUZZ=ON \
|
||||
$SRC/open62541/
|
||||
|
||||
# for now just use one processor, otherwise amalgamation may fail
|
||||
# This also builds all the fuzz targets and places them in the $OUT directory
|
||||
# Only build with one process otherwise amalgamation fails.
|
||||
make -j1
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Add additional definitions which are normally set with CMake
|
||||
# ------------------------------------------------------------
|
||||
|
||||
# Definitions
|
||||
CXXFLAGS="$CXXFLAGS -DUA_NO_AMALGAMATION"
|
||||
# Include dirs
|
||||
CXXFLAGS="$CXXFLAGS -I$WORK/open62541/src_generated -I$SRC/open62541/include -I$SRC/open62541/plugins -I$SRC/open62541/deps -I$SRC/open62541/src -I$SRC/open62541/src/server"
|
||||
|
||||
# ------------------------------------------------------------
|
||||
# Build all the fuzzing targets in tests/fuzz
|
||||
# ------------------------------------------------------------
|
||||
|
||||
fuzzerFiles=$(find $SRC/open62541/tests/fuzz/ -name "*.cc")
|
||||
|
||||
for F in $fuzzerFiles; do
|
||||
fuzzerName=$(basename $F .cc)
|
||||
echo "Building fuzzer $fuzzerName"
|
||||
|
||||
$CXX $CXXFLAGS -std=c++11 \
|
||||
$F -o $OUT/${fuzzerName} \
|
||||
-lFuzzingEngine -L $WORK/open62541/bin -lopen62541
|
||||
|
||||
if [ -d "$SRC/open62541/tests/fuzz/${fuzzerName}_corpus" ]; then
|
||||
zip -j $OUT/${fuzzerName}_seed_corpus.zip $SRC/open62541/tests/fuzz/${fuzzerName}_corpus/*
|
||||
fi
|
||||
done
|
||||
|
||||
cp $SRC/open62541/tests/fuzz/*.dict $SRC/open62541/tests/fuzz/*.options $OUT/
|
||||
# Copy the corpus, dict and options to the $OUT dir
|
||||
$SRC/open62541/tests/fuzz/oss-fuzz-copy.sh
|
||||
|
||||
echo "Built all fuzzer targets."
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
homepage: "https://open62541.org/"
|
||||
primary_contact: "Stefan.Profanter@gmail.com"
|
||||
auto_ccs:
|
||||
- "julius.pfrommer@iosb.fraunhofer.de"
|
||||
- "julius.pfrommer@gmail.com"
|
||||
- "f.palm@plt.rwth-aachen.de"
|
||||
- "chris_paul.iatrou@tu-dresden.de"
|
||||
sanitizers:
|
||||
|
|
Loading…
Reference in New Issue