brintos

brintos / llvm-project-archived public Read only

0
0
Text · 972 B · 03b59b2 Raw
35 lines · bash
1#!/bin/bash -eu2 3#4# This script runs the continuous fuzzing tests on OSS-Fuzz.5#6 7if [[ ${SANITIZER} = *undefined* ]]; then8  CXXFLAGS="${CXXFLAGS} -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow"9fi10 11BUILD=cxx_build_dir12INSTALL=cxx_install_dir13MONOREPO_ROOT=${PWD}14 15mkdir ${BUILD}16cmake -S ${MONOREPO_ROOT}/runtimes -B ${BUILD} \17      -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi;libunwind" \18      -DCMAKE_BUILD_TYPE=RelWithDebInfo \19      -DCMAKE_INSTALL_PREFIX="${INSTALL}"20cmake --build ${BUILD} --target install-cxx-headers21 22for test in libcxx/test/libcxx/fuzzing/*.pass.cpp; do23    exe="$(basename ${test})"24    exe="${exe%.pass.cpp}"25    ${CXX} ${CXXFLAGS} \26        -std=c++20 \27        -DLIBCPP_OSS_FUZZ \28        -D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS \29        -nostdinc++ -cxx-isystem ${INSTALL}/include/c++/v1 \30        -lpthread -ldl \31        -o "${OUT}/${exe}" \32        ${test} \33        ${LIB_FUZZING_ENGINE}34done35