File: build_like_ossfuzz.sh

package info (click to toggle)
simdjson 4.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,936 kB
  • sloc: cpp: 171,612; ansic: 19,122; sh: 1,126; python: 842; makefile: 47; ruby: 25; javascript: 13
file content (23 lines) | stat: -rwxr-xr-x 700 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh
#
# This script emulates how oss fuzz invokes the build
# process, handy for trouble shooting cmake issues and possibly
# recreating testcases. For proper debugging of the oss fuzz
# build, follow the procedure at https://google.github.io/oss-fuzz/getting-started/new-project-guide/#testing-locally

set -eu

ossfuzz=$(readlink -f $(dirname $0))/ossfuzz.sh

mkdir -p ossfuzz-out
export OUT=$(pwd)/ossfuzz-out
export CC=clang
export CXX="clang++"
export CFLAGS="-fsanitize=fuzzer-no-link"
export CXXFLAGS="-fsanitize=fuzzer-no-link,address,undefined -O1 -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION"
export LIB_FUZZING_ENGINE="-fsanitize=fuzzer"

$ossfuzz

echo "look at the results in $OUT"