llvm-project/libcxx/utils/ci/oss-fuzz.sh
Louis Dionne 342e0ebd0b Revert the removal of LLVM_ENABLE_PROJECTS for libc++ and libc++abi
This commit reverts the following commits:

- 952f90b72b3546d6b6b038d410f07ce520c59b48
- e6a0800532bb409f6d1c62f3698bdd6994a877dc (D132298)
- 176db3b3ab25ff8a9b2405f50ef5a8bd9304a6d5 (D132324)

These commits caused CI instability and need to be reverted in order
to figure things out again. See the discussion in https://llvm.org/D132324
for more information.
2022-08-23 09:58:30 -04:00

34 lines
922 B
Bash
Executable File

#!/bin/bash -eu
#
# This script runs the continuous fuzzing tests on OSS-Fuzz.
#
if [[ ${SANITIZER} = *undefined* ]]; then
CXXFLAGS="${CXXFLAGS} -fsanitize=unsigned-integer-overflow -fsanitize-trap=unsigned-integer-overflow"
fi
BUILD=cxx_build_dir
INSTALL=cxx_install_dir
mkdir ${BUILD}
cmake -S ${PWD} -B ${BUILD} \
-DLLVM_ENABLE_PROJECTS="libcxx;libcxxabi" \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_INSTALL_PREFIX="${INSTALL}"
cmake --build ${BUILD} --target install-cxx-headers
for test in libcxx/test/libcxx/fuzzing/*.pass.cpp; do
exe="$(basename ${test})"
exe="${exe%.pass.cpp}"
${CXX} ${CXXFLAGS} \
-std=c++14 \
-DLIBCPP_OSS_FUZZ \
-D_LIBCPP_HAS_NO_VENDOR_AVAILABILITY_ANNOTATIONS \
-nostdinc++ -cxx-isystem ${INSTALL}/include/c++/v1 \
-lpthread -ldl \
-o "${OUT}/${exe}" \
${test} \
${LIB_FUZZING_ENGINE}
done