File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed
Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -26,5 +26,8 @@ RUN mkdir $SRC/sqlite3 && \
2626
2727RUN find $SRC/sqlite3 -name "*.test" | xargs zip $SRC/ossfuzz_seed_corpus.zip
2828
29+ RUN apt-get update && apt-get install -y cmake liblzma-dev
30+ RUN git clone https://github.com/ligurio/sqlsmith_proto $SRC/sqlsmith_proto
31+
2932WORKDIR sqlite3
3033COPY build.sh *.dict *.options run_tests.sh $SRC/
Original file line number Diff line number Diff line change @@ -41,3 +41,41 @@ $CXX $CXXFLAGS \
4141 $LIB_FUZZING_ENGINE ./sqlite3.o
4242
4343cp $SRC /* .options $SRC /* .dict $SRC /* .zip $OUT /
44+
45+ cd $SRC /sqlsmith_proto
46+
47+ case $SANITIZER in
48+ address) SANITIZERS_ARGS=" -DENABLE_ASAN=ON" ;;
49+ undefined) SANITIZERS_ARGS=" -DENABLE_UBSAN=ON" ;;
50+ * ) SANITIZERS_ARGS=" " ;;
51+ esac
52+
53+ : ${LD:= " ${CXX} " }
54+ : ${LDFLAGS:= " ${CXXFLAGS} " } # to make sure we link with sanitizer runtime
55+
56+ cmake_args=(
57+ -DCMAKE_BUILD_TYPE=Debug
58+ -DOSS_FUZZ=ON
59+ -DBUNDLED_PROTOBUF=OFF
60+ $SANITIZERS_ARGS
61+ # C compiler
62+ -DCMAKE_C_COMPILER=" ${CC} "
63+ -DCMAKE_C_FLAGS=" ${CFLAGS} "
64+ # C++ compiler
65+ -DCMAKE_CXX_COMPILER=" ${CXX} "
66+ -DCMAKE_CXX_FLAGS=" ${CXXFLAGS} "
67+ # Linker
68+ -DCMAKE_LINKER=" ${LD} "
69+ -DCMAKE_EXE_LINKER_FLAGS=" ${LDFLAGS} "
70+ -DCMAKE_MODULE_LINKER_FLAGS=" ${LDFLAGS} "
71+ -DCMAKE_SHARED_LINKER_FLAGS=" ${LDFLAGS} "
72+ )
73+
74+ [[ -e build ]] && rm -rf build
75+ cmake " ${cmake_args[@]} " -S . -B build
76+ cmake --build build --parallel --verbose
77+
78+ for f in $( find build -name ' *_test' -type f) ;
79+ do
80+ cp $f $OUT /
81+ done
You can’t perform that action at this time.
0 commit comments