mirror of https://github.com/google/oss-fuzz.git
parent
a83ce13c54
commit
4896be51cd
|
@ -26,6 +26,9 @@ ENV SANITIZER_FLAGS_memory "-fsanitize=memory -fsanitize-memory-track-origins"
|
|||
# Default build flags for coverage.
|
||||
ENV COVERAGE_FLAGS="-fsanitize-coverage=trace-pc-guard,trace-cmp"
|
||||
|
||||
# Coverage flags for generating coverage reports.
|
||||
ENV COVERAGE_FLAGS_coverage="-fsanitize-coverage=bb,no-prune,trace-pc-guard"
|
||||
|
||||
# Default sanitizer and fuzzing engine to use.
|
||||
ENV SANITIZER="address"
|
||||
ENV FUZZING_ENGINE="libfuzzer"
|
||||
|
|
|
@ -19,7 +19,7 @@ echo "---------------------------------------------------------------"
|
|||
|
||||
if [ -z "${SANITIZER_FLAGS-}" ]; then
|
||||
FLAGS_VAR="SANITIZER_FLAGS_${SANITIZER}"
|
||||
export SANITIZER_FLAGS=$(echo ${!FLAGS_VAR})
|
||||
export SANITIZER_FLAGS=${!FLAGS_VAR-}
|
||||
fi
|
||||
|
||||
# compile script might override environment, use . to call it.
|
||||
|
@ -32,10 +32,16 @@ then
|
|||
cp -R /usr/msan/lib/* /usr/lib/
|
||||
fi
|
||||
|
||||
# Coverage flag overrides.
|
||||
COVERAGE_FLAGS_VAR="COVERAGE_FLAGS_$SANITIZER"
|
||||
if [[ -n ${!COVERAGE_FLAGS_VAR-} ]]
|
||||
then
|
||||
export COVERAGE_FLAGS="${!COVERAGE_FLAGS_VAR}"
|
||||
fi
|
||||
|
||||
export CFLAGS="$CFLAGS $SANITIZER_FLAGS $COVERAGE_FLAGS"
|
||||
export CXXFLAGS="$CFLAGS $CXXFLAGS_EXTRA"
|
||||
|
||||
|
||||
echo "CC=$CC"
|
||||
echo "CXX=$CXX"
|
||||
echo "CFLAGS=$CFLAGS"
|
||||
|
|
|
@ -24,6 +24,7 @@ CONFIGURATIONS = {
|
|||
'sanitizer-address' : [ 'SANITIZER=address' ],
|
||||
'sanitizer-memory' : [ 'SANITIZER=memory' ],
|
||||
'sanitizer-undefined' : [ 'SANITIZER=undefined' ],
|
||||
'sanitizer-coverage' : [ 'SANITIZER=coverage' ],
|
||||
'engine-libfuzzer' : [ 'FUZZING_ENGINE=libfuzzer' ],
|
||||
'engine-afl' : [ 'FUZZING_ENGINE=afl' ],
|
||||
}
|
||||
|
@ -34,7 +35,7 @@ EngineInfo = collections.namedtuple(
|
|||
ENGINE_INFO = {
|
||||
'libfuzzer': EngineInfo(
|
||||
upload_bucket='clusterfuzz-builds',
|
||||
supported_sanitizers=['address', 'memory', 'undefined']),
|
||||
supported_sanitizers=['address', 'memory', 'undefined', 'coverage']),
|
||||
'afl': EngineInfo(
|
||||
upload_bucket='clusterfuzz-builds-afl',
|
||||
supported_sanitizers=['address']),
|
||||
|
|
Loading…
Reference in New Issue