1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

AK+Meta: Disable consteval completely when building for oss-fuzz

This was missed in 02b74e5a70

We need to disable consteval in AK::String as well as AK::StringView,
and we need to disable it when building both the tools build and the
fuzzer build.
This commit is contained in:
Andrew Kaster 2023-06-29 14:35:03 -06:00 committed by Andrew Kaster
parent 5bc2c333bd
commit bfd6deed1e
2 changed files with 7 additions and 1 deletions

View file

@ -30,7 +30,8 @@ class StringData;
} }
// FIXME: Remove this when OpenBSD Clang fully supports consteval. // FIXME: Remove this when OpenBSD Clang fully supports consteval.
#if defined(AK_OS_OPENBSD) // And once oss-fuzz updates to clang >15.
#if defined(AK_OS_OPENBSD) || defined(OSS_FUZZ)
# define AK_SHORT_STRING_CONSTEVAL constexpr # define AK_SHORT_STRING_CONSTEVAL constexpr
#else #else
# define AK_SHORT_STRING_CONSTEVAL consteval # define AK_SHORT_STRING_CONSTEVAL consteval

View file

@ -46,10 +46,15 @@ unset CFLAGS
unset CXXFLAGS unset CXXFLAGS
export AFL_NOOPT=1 export AFL_NOOPT=1
if [ "$#" -gt "0" ] && [ "--oss-fuzz" = "$1" ] ; then
CXXFLAGS="$CXXFLAGS -DOSS_FUZZ=ON"
fi
# FIXME: Replace these CMake invocations with a CMake superbuild? # FIXME: Replace these CMake invocations with a CMake superbuild?
echo "Building Lagom Tools..." echo "Building Lagom Tools..."
cmake -GNinja -B Build/tools \ cmake -GNinja -B Build/tools \
-DBUILD_LAGOM=OFF \ -DBUILD_LAGOM=OFF \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_INSTALL_PREFIX=Build/tool-install \ -DCMAKE_INSTALL_PREFIX=Build/tool-install \
-Dpackage=LagomTools -Dpackage=LagomTools
ninja -C Build/tools install ninja -C Build/tools install