From c197d39435d1c24a68c89deb1d45ff3ef1e392a7 Mon Sep 17 00:00:00 2001 From: Louis Dionne Date: Fri, 16 Oct 2020 17:35:11 -0400 Subject: [PATCH] [libc++] Execute the oss-fuzz script located in the libc++ tree (#4541) --- projects/llvm_libcxx/Dockerfile | 1 + projects/llvm_libcxx/build.sh | 21 ++------------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/projects/llvm_libcxx/Dockerfile b/projects/llvm_libcxx/Dockerfile index 389b3653c..81fd8b289 100644 --- a/projects/llvm_libcxx/Dockerfile +++ b/projects/llvm_libcxx/Dockerfile @@ -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/ diff --git a/projects/llvm_libcxx/build.sh b/projects/llvm_libcxx/build.sh index 56130d3fb..b7f61c758 100755 --- a/projects/llvm_libcxx/build.sh +++ b/projects/llvm_libcxx/build.sh @@ -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 < -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