• Home
  • Raw
  • Download

Lines Matching +full:run +full:- +full:shellcheck

3 # The script is used to build the fuzz targets run on ClusterFuzz. It has to be
5 # https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh
7 # and so on (https://google.github.io/oss-fuzz/getting-started/new-project-guide/#buildsh-script-en…
9 # in C: https://google.github.io/oss-fuzz/getting-started/new-project-guide/#Requirements
12 # mode. To run secilc-fuzzer against a test case (named, say, CRASH) triggering an issue
13 # the following commands should be run
15 # $ ./scripts/oss-fuzz.sh
16 # $ ./out/secilc-fuzzer CRASH
18 # To run the fuzzer against the corpus OSS-Fuzz has accumulated so far it should be
21 …t https://storage.googleapis.com/selinux-backup.clusterfuzz-external.appspot.com/corpus/libFuzzer/…
22 # $ unzip -d CORPUS public.zip
23 # $ ./out/secilc-fuzzer CORPUS/
25 set -eux
27 cd "$(dirname -- "$0")/.."
29 export DESTDIR=${DESTDIR:-$(pwd)/DESTDIR}
31 SANITIZER=${SANITIZER:-address}
32 flags="-O1 -fno-omit-frame-pointer -gline-tables-only -DFUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION -f…
34 export CC=${CC:-clang}
35 export CFLAGS="${CFLAGS:-$flags} -I$DESTDIR/usr/include -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"
37 export CXX=${CXX:-clang++}
38 export CXXFLAGS=${CXXFLAGS:-$flags}
40 export OUT=${OUT:-$(pwd)/out}
41 mkdir -p "$OUT"
43 export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
45 rm -rf "$DESTDIR"
46 make -C libsepol clean
49 # shellcheck disable=SC2016
50 make -C libsepol V=1 LD_SONAME_FLAGS='-soname,$(LIBSO),--version-script=$(LIBMAP)' -j"$(nproc)" ins…
56 # shellcheck disable=SC2086
57 $CC $CFLAGS -c -o secilc-fuzzer.o libsepol/fuzz/secilc-fuzzer.c
58 # shellcheck disable=SC2086
59 $CXX $CXXFLAGS $LIB_FUZZING_ENGINE secilc-fuzzer.o "$DESTDIR/usr/lib/libsepol.a" -o "$OUT/secilc-fu…
61 zip -r "$OUT/secilc-fuzzer_seed_corpus.zip" secilc/test
67 # shellcheck disable=SC2086
68 $CC $CFLAGS -c -o binpolicy-fuzzer.o libsepol/fuzz/binpolicy-fuzzer.c
69 # shellcheck disable=SC2086
70 $CXX $CXXFLAGS $LIB_FUZZING_ENGINE binpolicy-fuzzer.o "$DESTDIR/usr/lib/libsepol.a" -o "$OUT/binpol…
72 zip -j "$OUT/binpolicy-fuzzer_seed_corpus.zip" libsepol/fuzz/policy.bin