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