diff options
author | Tim Schumacher <timschumi@gmx.de> | 2022-03-29 16:31:51 +0200 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2022-03-31 22:11:04 -0700 |
commit | e3519b8e5cb740044c995aba854871db90f9d338 (patch) | |
tree | 6eb95fd2e7cabe753d42d374ca7294f0643e3cac /Meta/Lagom | |
parent | 7d51696d5d34564c169afc15774d91a0e6281223 (diff) | |
download | serenity-e3519b8e5cb740044c995aba854871db90f9d338.zip |
Meta: Rename Fuzzer flags to `ENABLE_FUZZERS_{LIBFUZZER,OSSFUZZ}`
Diffstat (limited to 'Meta/Lagom')
-rwxr-xr-x | Meta/Lagom/BuildFuzzers.sh | 4 | ||||
-rw-r--r-- | Meta/Lagom/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Meta/Lagom/Fuzzers/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Meta/Lagom/Fuzzers/FuzzilliJs.dockerfile | 2 | ||||
-rw-r--r-- | Meta/Lagom/ReadMe.md | 4 |
5 files changed, 14 insertions, 14 deletions
diff --git a/Meta/Lagom/BuildFuzzers.sh b/Meta/Lagom/BuildFuzzers.sh index 78371d8fdf..3db5ad6951 100755 --- a/Meta/Lagom/BuildFuzzers.sh +++ b/Meta/Lagom/BuildFuzzers.sh @@ -61,7 +61,7 @@ if [ "$#" -gt "0" ] && [ "--oss-fuzz" = "$1" ] ; then cmake -GNinja -B Build/fuzzers \ -DBUILD_LAGOM=ON \ -DBUILD_SHARED_LIBS=OFF \ - -DENABLE_OSS_FUZZ=ON \ + -DENABLE_FUZZERS_OSSFUZZ=ON \ -DCMAKE_C_COMPILER="$CC" \ -DCMAKE_CXX_COMPILER="$CXX" \ -DCMAKE_CXX_FLAGS="$CXXFLAGS -DOSS_FUZZ=ON" \ @@ -74,7 +74,7 @@ else pick_clang cmake -GNinja -B Build/lagom-fuzzers \ -DBUILD_LAGOM=ON \ - -DENABLE_FUZZER_SANITIZER=ON \ + -DENABLE_FUZZERS_LIBFUZZER=ON \ -DENABLE_ADDRESS_SANITIZER=ON \ -DENABLE_UNDEFINED_SANITIZER=ON \ -DCMAKE_PREFIX_PATH=Build/tool-install \ diff --git a/Meta/Lagom/CMakeLists.txt b/Meta/Lagom/CMakeLists.txt index 1390aebe8e..b7bbf1d886 100644 --- a/Meta/Lagom/CMakeLists.txt +++ b/Meta/Lagom/CMakeLists.txt @@ -64,7 +64,7 @@ add_compile_options(-Wall -Wextra -Werror) add_compile_options(-fPIC -g) add_compile_options(-Wno-maybe-uninitialized) add_compile_options(-fno-exceptions) -if (NOT ENABLE_FUZZER_SANITIZER) +if (NOT ENABLE_FUZZERS_LIBFUZZER) add_compile_options(-fno-semantic-interposition) endif() @@ -109,14 +109,14 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$") # Clang's default constexpr-steps limit is 1048576(2^20), GCC doesn't have one add_compile_options(-Wno-overloaded-virtual -Wno-user-defined-literals -fconstexpr-steps=16777216) - if (ENABLE_FUZZER_SANITIZER) + if (ENABLE_FUZZERS_LIBFUZZER) add_compile_options(-fsanitize=fuzzer -fno-omit-frame-pointer) set(LINKER_FLAGS "${LINKER_FLAGS} -fsanitize=fuzzer") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") add_compile_options(-Wno-expansion-to-defined) - if (ENABLE_FUZZER_SANITIZER) + if (ENABLE_FUZZERS_LIBFUZZER) message(FATAL_ERROR "Fuzzer Sanitizer (-fsanitize=fuzzer) is only supported for Fuzzer targets with LLVM. " "Reconfigure CMake with -DCMAKE_C_COMPILER and -DCMAKE_CXX_COMPILER pointing to a clang-based toolchain" @@ -173,7 +173,7 @@ function(lagom_lib library fs_name) # Don't make alias when we're going to import a previous build for Tools # FIXME: Is there a better way to write this? - if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER) + if (NOT ENABLE_FUZZERS_OSSFUZZ AND NOT ENABLE_FUZZERS_LIBFUZZER) # alias for parity with exports add_library(Lagom::${library} ALIAS ${target_name}) endif() @@ -272,7 +272,7 @@ install( # Code Generators and other host tools # We need to make sure not to build code generators for Fuzzer builds, as they already have their own main.cpp # Instead, we import them from a previous install of Lagom. This mandates a two-stage build for fuzzers. -if (ENABLE_OSS_FUZZ OR ENABLE_FUZZER_SANITIZER) +if (ENABLE_FUZZERS_OSSFUZZ OR ENABLE_FUZZERS_LIBFUZZER) find_package(Lagom REQUIRED) else() add_subdirectory(Tools) @@ -483,7 +483,7 @@ if (BUILD_LAGOM) lagom_lib(XML xml SOURCES ${LIBXML_SOURCES}) - if (NOT ENABLE_OSS_FUZZ AND NOT ENABLE_FUZZER_SANITIZER AND NOT ENABLE_COMPILER_EXPLORER_BUILD) + if (NOT ENABLE_FUZZERS_OSSFUZZ AND NOT ENABLE_FUZZERS_LIBFUZZER AND NOT ENABLE_COMPILER_EXPLORER_BUILD) # Lagom Examples add_executable(TestApp TestApp.cpp) target_link_libraries(TestApp LagomCore) @@ -711,6 +711,6 @@ if (BUILD_LAGOM) endif() endif() -if (ENABLE_FUZZER_SANITIZER OR ENABLE_OSS_FUZZ) +if (ENABLE_FUZZERS_LIBFUZZER OR ENABLE_FUZZERS_OSSFUZZ) add_subdirectory(Fuzzers) endif() diff --git a/Meta/Lagom/Fuzzers/CMakeLists.txt b/Meta/Lagom/Fuzzers/CMakeLists.txt index 6fa8da4750..fcca4e55df 100644 --- a/Meta/Lagom/Fuzzers/CMakeLists.txt +++ b/Meta/Lagom/Fuzzers/CMakeLists.txt @@ -1,7 +1,7 @@ function(add_simple_fuzzer name) add_executable(${name} "${name}.cpp") - if (ENABLE_OSS_FUZZ) + if (ENABLE_FUZZERS_OSSFUZZ) target_link_libraries(${name} PUBLIC ${ARGN} LagomCore) else() @@ -63,7 +63,7 @@ add_simple_fuzzer(FuzzWasmParser LagomWasm) add_simple_fuzzer(FuzzZip LagomArchive) add_simple_fuzzer(FuzzZlibDecompression LagomCompress) -if (NOT ENABLE_OSS_FUZZ) +if (NOT ENABLE_FUZZERS_OSSFUZZ) set(CMAKE_EXE_LINKER_FLAGS "${ORIGINAL_CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_SHARED_LINKER_FLAGS "${ORIGINAL_CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") set(CMAKE_MODULE_LINKER_FLAGS "${ORIGINAL_CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address") diff --git a/Meta/Lagom/Fuzzers/FuzzilliJs.dockerfile b/Meta/Lagom/Fuzzers/FuzzilliJs.dockerfile index abbf2ebc7e..2370e2fd90 100644 --- a/Meta/Lagom/Fuzzers/FuzzilliJs.dockerfile +++ b/Meta/Lagom/Fuzzers/FuzzilliJs.dockerfile @@ -39,7 +39,7 @@ RUN sed -i 's/-Wmissing-declarations //' ../CMakeLists.txt RUN CXXFLAGS="-Wno-defaulted-function-deleted" \ cmake -GNinja \ -DBUILD_LAGOM=ON \ - -DENABLE_FUZZER_SANITIZER=ON \ + -DENABLE_FUZZERS_LIBFUZZER=ON \ -DCMAKE_C_COMPILER=clang \ -DCMAKE_CXX_COMPILER=clang++ \ .. diff --git a/Meta/Lagom/ReadMe.md b/Meta/Lagom/ReadMe.md index dcc4c6d9a3..0b186f920c 100644 --- a/Meta/Lagom/ReadMe.md +++ b/Meta/Lagom/ReadMe.md @@ -27,7 +27,7 @@ the ``BuildFuzzers.sh`` script with no arguments. The script does the equivalent # Stage 2: Build fuzzers, making sure the build can find the tools we just built cmake -GNinja -B Build/lagom-fuzzers \ -DBUILD_LAGOM=ON \ - -DENABLE_FUZZER_SANITIZER=ON \ + -DENABLE_FUZZERS_LIBFUZZER=ON \ -DENABLE_ADDRESS_SANITIZER=ON \ -DENABLE_UNDEFINED_SANITIZER=ON \ -DCMAKE_PREFIX_PATH=Build/tool-install \ @@ -72,7 +72,7 @@ Feel free to upload lots and lots files there, or use them for great good! ### Fuzzing on OSS-Fuzz -https://oss-fuzz.com/ automatically runs all fuzzers in the Fuzzers/ subdirectory whose name starts with "Fuzz" and which are added to the build in `Fuzzers/CMakeLists.txt` if `ENABLE_OSS_FUZZ` is set. Looking for "serenity" on oss-fuzz.com finds interesting links, in particular: +https://oss-fuzz.com/ automatically runs all fuzzers in the Fuzzers/ subdirectory whose name starts with "Fuzz" and which are added to the build in `Fuzzers/CMakeLists.txt` if `ENABLE_FUZZERS_OSSFUZZ` is set. Looking for "serenity" on oss-fuzz.com finds interesting links, in particular: * [known open bugs found by fuzzers](https://oss-fuzz.com/testcases?project=serenity&open=yes) * [oss-fuzz bug tracker for these](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:serenity) |