mirror of https://github.com/google/oss-fuzz.git
serenity: fix entire project build. (#4738)
This commit is contained in:
parent
753a2a4c5b
commit
c28f4d8412
|
@ -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
|
||||
|
|
|
@ -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 $<TARGET_OBJECTS:LagomCore> ${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
|
||||
|
|
|
@ -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 $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize=fuzzer>
|
||||
)
|
||||
target_link_libraries(${name}
|
||||
PUBLIC Lagom
|
||||
PRIVATE $<$<C_COMPILER_ID:Clang>:-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 $<$<C_COMPILER_ID:Clang>:-g -O1 -fsanitize-coverage=trace-pc-guard>
|
||||
)
|
||||
target_link_libraries(FuzzilliJs
|
||||
PUBLIC Lagom
|
||||
PRIVATE $<$<C_COMPILER_ID:Clang>:-fsanitize-coverage=trace-pc-guard>
|
||||
)
|
||||
endif()
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue