From c28f4d8412d5478c7c925ca80c2598b91a282245 Mon Sep 17 00:00:00 2001 From: DavidKorczynski Date: Sat, 28 Nov 2020 16:28:22 +0000 Subject: [PATCH] serenity: fix entire project build. (#4738) --- projects/serenity/Dockerfile | 1 - projects/serenity/build.sh | 13 +--------- projects/serenity/fuzz_CMakeLists.txt | 36 --------------------------- projects/serenity/project.yaml | 3 +++ 4 files changed, 4 insertions(+), 49 deletions(-) delete mode 100644 projects/serenity/fuzz_CMakeLists.txt diff --git a/projects/serenity/Dockerfile b/projects/serenity/Dockerfile index c7e71d90b..7b2348c68 100644 --- a/projects/serenity/Dockerfile +++ b/projects/serenity/Dockerfile @@ -19,4 +19,3 @@ RUN apt-get update && apt-get install -y build-essential cmake curl libmpfr-dev RUN git clone https://github.com/SerenityOS/serenity WORKDIR $SRC COPY build.sh $SRC/ -COPY fuzz_CMakeLists.txt $SRC/serenity/Meta/Lagom/Fuzzers/CMakeLists.txt diff --git a/projects/serenity/build.sh b/projects/serenity/build.sh index d04f96ab3..3f11bbfaf 100755 --- a/projects/serenity/build.sh +++ b/projects/serenity/build.sh @@ -15,17 +15,6 @@ # ################################################################################ -# We dont have getentropy syscall, so always return error when this is issued. -# The result is not breaking, but rather an under-approximation of all the possible states. -sed -i 's/int rc = getentropy(buffer, length);/int rc;\nif (buffer \&\& length) { rc = -1; } else {rc = -1; };/' serenity/AK/Random.h - -sed -i 's/if (BUILD_LAGOM)/if (BUILD_LAGOM)\n add_library(Lagom $ ${LAGOM_MORE_SOURCES})\nendif()\nif(FALSE)/' serenity/Meta/Lagom/CMakeLists.txt - -echo "if (ENABLE_OSS_FUZZ)" >> serenity/Meta/Lagom/CMakeLists.txt -echo " add_subdirectory(Fuzzers)" >> serenity/Meta/Lagom/CMakeLists.txt -echo "endif()" >> serenity/Meta/Lagom/CMakeLists.txt -sed -i 's/-Wall -Wextra -Werror //' serenity/Meta/Lagom/CMakeLists.txt - # Now build the content cd serenity/Meta/Lagom mkdir build @@ -34,7 +23,7 @@ cmake -DBUILD_LAGOM=ON \ -DENABLE_OSS_FUZZ=ON \ -DCMAKE_C_COMPILER=$CC \ -DCMAKE_CXX_COMPILER=$CXX \ - -DCMAKE_CXX_FLAGS="$CXXFLAGS" \ + -DCMAKE_CXX_FLAGS="$CXXFLAGS -DOSS_FUZZ=ON" \ -DLINKER_FLAGS="$LIB_FUZZING_ENGINE" \ .. make diff --git a/projects/serenity/fuzz_CMakeLists.txt b/projects/serenity/fuzz_CMakeLists.txt deleted file mode 100644 index 407084e50..000000000 --- a/projects/serenity/fuzz_CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ -function(add_simple_fuzzer name) - add_executable(${name} "${name}.cpp") - if (ENABLE_OSS_FUZZ) - target_link_libraries(${name} - PUBLIC Lagom) - else() - target_compile_options(${name} - PRIVATE $<$:-g -O1 -fsanitize=fuzzer> - ) - target_link_libraries(${name} - PUBLIC Lagom - PRIVATE $<$:-fsanitize=fuzzer> - ) - endif() - -endfunction() - -add_simple_fuzzer(FuzzBMP) -add_simple_fuzzer(FuzzELF) -add_simple_fuzzer(FuzzGemini) -add_simple_fuzzer(FuzzGIFLoader) -add_simple_fuzzer(FuzzJPGLoader) -add_simple_fuzzer(FuzzPPMLoader) -add_simple_fuzzer(FuzzJs) -add_simple_fuzzer(FuzzMarkdown) - -if (NOT ENABLE_OSS_FUZZ) - add_executable(FuzzilliJs FuzzilliJs.cpp) - target_compile_options(FuzzilliJs - PRIVATE $<$:-g -O1 -fsanitize-coverage=trace-pc-guard> - ) - target_link_libraries(FuzzilliJs - PUBLIC Lagom - PRIVATE $<$:-fsanitize-coverage=trace-pc-guard> - ) -endif() diff --git a/projects/serenity/project.yaml b/projects/serenity/project.yaml index 89500439e..2a4384b02 100644 --- a/projects/serenity/project.yaml +++ b/projects/serenity/project.yaml @@ -3,6 +3,9 @@ language: c++ primary_contact: "kling@serenityos.org" auto_ccs: - "david@adalogics.com" + - "mail@linusgroh.de" + - "ali.mpfard@gmail.com" + - "luke.wilde@live.co.uk" # Bug reports are public by default: view_restrictions: none