aboutsummaryrefslogtreecommitdiff
path: root/projects/libreoffice
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2021-02-06 23:58:58 +0100
committerGitHub <noreply@github.com>2021-02-06 22:58:58 +0000
commit380687236a9b2709769786458ddc437366d6546e (patch)
treebafeacf57afb144e52f98b4e91c646113b807a8c /projects/libreoffice
parent0b8d8d6d040419f23f6ff1aee6842e5b3a834f42 (diff)
downloadoss-fuzz-380687236a9b2709769786458ddc437366d6546e.tar.gz
optimal afl++ defaults (#5129)
* optimal afl++ defaults * fixes
Diffstat (limited to 'projects/libreoffice')
-rwxr-xr-xprojects/libreoffice/build.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/projects/libreoffice/build.sh b/projects/libreoffice/build.sh
index cec8368db..22320f1e9 100755
--- a/projects/libreoffice/build.sh
+++ b/projects/libreoffice/build.sh
@@ -1,3 +1,35 @@
#!/bin/bash -eu
+# Copyright 2021 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.
+#
+################################################################################
+
+# afl++ workaround, as afl-clang-fast does not work yet.
+test -n "$AFL_MAP_SIZE" && {
+ export CC=clang
+ export CXX=clang++
+ AFL_FLAGS="-fsanitize-coverage=trace-pc-guard"
+ # Future: enable 40% chance for cmplog lite
+ # rm -f $WORK/afl_cmplog
+ # test $(($RANDOM % 10)) -lt 4 && {
+ # AFL_FLAGS="$AFL_FLAGS,trace-cmp"
+ # touch $WORK/afl_cmplog
+ # }
+ export CFLAGS="$AFL_FLAGS $CFLAGS"
+ export CXXFLAGS="$AFL_FLAGS $CXXFLAGS"
+ rm -f $LIB_FUZZING_ENGINE
+ ar ru $LIB_FUZZING_ENGINE $SRC/aflplusplus/afl-compiler-rt.o $SRC/aflplusplus/utils/aflpp_driver/aflpp_driver.o || exit 1
+}
$SRC/libreoffice/bin/oss-fuzz-build.sh