From 8b189b7eb02a3257821a79ffcc224075acd627c7 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Sat, 22 Jun 2024 18:07:32 +0200 Subject: [PATCH] Fuzzers: Use libc++ on OSS-Fuzz for Lagom code generators By unsetting `CXXFLAGS` in order to build Lagom code generators without instrumentation, we were also removing `-stdlib=libc++`, so Clang ended up using the runner image's libstdc++ 9 headers. These are too old, and don't contain ``, leading to a build failure. Fixes #24578 --- Meta/Lagom/BuildFuzzers.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Meta/Lagom/BuildFuzzers.sh b/Meta/Lagom/BuildFuzzers.sh index 0f01928da4..965d81b7e0 100755 --- a/Meta/Lagom/BuildFuzzers.sh +++ b/Meta/Lagom/BuildFuzzers.sh @@ -47,7 +47,10 @@ unset CXXFLAGS export AFL_NOOPT=1 if [ "$#" -gt "0" ] && [ "--oss-fuzz" = "$1" ] ; then - CXXFLAGS="$CXXFLAGS -DOSS_FUZZ=ON" + # The oss-fuzz runner image (as of June 2024) has libstdc++ 9, which lacks the + # header. Use the more modern libc++ shipped with oss-fuzz's Clang. + # It's already set in CXXFLAGS_SAVE. + CXXFLAGS="$CXXFLAGS -DOSS_FUZZ=ON -stdlib=libc++" fi # FIXME: Replace these CMake invocations with a CMake superbuild?