mirror of https://github.com/google/oss-fuzz.git
[libc++] Execute the oss-fuzz script located in the libc++ tree (#4541)
This commit is contained in:
parent
e67253def1
commit
c197d39435
|
@ -15,4 +15,5 @@
|
|||
################################################################################
|
||||
FROM gcr.io/oss-fuzz-base/base-builder
|
||||
RUN git clone --depth 1 https://github.com/llvm/llvm-project.git
|
||||
WORKDIR llvm-project
|
||||
COPY build.sh $SRC/
|
||||
|
|
|
@ -15,22 +15,5 @@
|
|||
#
|
||||
################################################################################
|
||||
|
||||
cd llvm-project
|
||||
|
||||
if [[ $SANITIZER = *undefined* ]]; then
|
||||
CXXFLAGS="$CXXFLAGS -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow"
|
||||
fi
|
||||
|
||||
for f in $(grep -v "#" libcxx/fuzzing/RoutineNames.txt); do
|
||||
cat > ${f}_fuzzer.cc <<EOF
|
||||
#include "fuzzing/fuzzing.h"
|
||||
#include <cassert>
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
|
||||
int result = fuzzing::$f(data, size);
|
||||
assert(result == 0); return 0;
|
||||
}
|
||||
EOF
|
||||
$CXX $CXXFLAGS -std=c++11 ${f}_fuzzer.cc ./libcxx/fuzzing/fuzzing.cpp \
|
||||
-nostdinc++ -cxx-isystem ./libcxx/include -iquote ./libcxx \
|
||||
-o $OUT/$f $LIB_FUZZING_ENGINE
|
||||
done
|
||||
# Run the oss-fuzz script in the repository
|
||||
./libcxx/utils/ci/oss-fuzz.sh
|
||||
|
|
Loading…
Reference in New Issue