aboutsummaryrefslogtreecommitdiffhomepage
path: root/projects/sqlite3/build.sh
diff options
context:
space:
mode:
authorGravatar Abhishek Arya <inferno@chromium.org>2016-11-29 10:58:16 -0800
committerGravatar Abhishek Arya <inferno@chromium.org>2016-11-29 10:58:31 -0800
commitc03c92cce0b04ba2be95a8ac421c9d41777e8e7d (patch)
treea53a87674514234812f01a4c95208cc4554c6c84 /projects/sqlite3/build.sh
parentea87305a11ab9654ea315c666f581785a862dcb6 (diff)
parentef765503cb3bbf7d2f82cdf01ccc033f6008ac91 (diff)
Merge branch 'master' of https://github.com/google/oss-fuzz
Diffstat (limited to 'projects/sqlite3/build.sh')
-rwxr-xr-xprojects/sqlite3/build.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/projects/sqlite3/build.sh b/projects/sqlite3/build.sh
new file mode 100755
index 00000000..5a0bbbf1
--- /dev/null
+++ b/projects/sqlite3/build.sh
@@ -0,0 +1,38 @@
+#!/bin/bash -eu
+# Copyright 2016 Google Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+
+mkdir bld
+cd bld
+
+export ASAN_OPTIONS=detect_leaks=0
+# Limit max length of data blobs and sql queries to prevent irrelevant OOMs.
+export CFLAGS="$CFLAGS -DSQLITE_MAX_LENGTH=128000000 \
+ -DSQLITE_MAX_SQL_LENGTH=128000000 \
+ -DSQLITE_PRINTF_PRECISION_LIMIT=128000000"
+../configure
+make -j$(nproc)
+make sqlite3.c
+
+$CC $CCFLAGS -I. -c \
+ $SRC/sqlite3/test/ossfuzz.c -o $SRC/sqlite3/test/ossfuzz.o
+
+$CXX $CXXFLAGS \
+ $SRC/sqlite3/test/ossfuzz.o -o $OUT/ossfuzz \
+ -lfuzzer ./sqlite3.o
+
+cp $SRC/*.options $SRC/*.dict $SRC/*.zip $OUT/
+