Skip to content

Commit

Permalink
ci: use newer version of libFuzzer (aws#4762)
Browse files Browse the repository at this point in the history
  • Loading branch information
jouho authored Sep 11, 2024
1 parent 79fdd44 commit 341a69e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@ if(NO_STACK_PROTECTOR)
endif()

if(S2N_FUZZ_TEST)
target_compile_options(${PROJECT_NAME} PUBLIC -fsanitize-coverage=trace-pc-guard -fsanitize=leak)
target_link_libraries(${PROJECT_NAME} PUBLIC -fsanitize-coverage=trace-pc-guard -fsanitize=leak)
target_compile_options(${PROJECT_NAME} PUBLIC -fsanitize=fuzzer-no-link,leak)
target_link_libraries(${PROJECT_NAME} PUBLIC -fsanitize=fuzzer-no-link,leak)
endif()

if(TSAN)
Expand Down Expand Up @@ -602,10 +602,6 @@ if (BUILD_TESTING)
target_link_libraries(fuzztest PUBLIC ${PROJECT_NAME})

# Set default values for fuzzing if not defined
if(NOT DEFINED LIBFUZZER_LIB)
message(FATAL_ERROR "LIBFUZZER_LIB is not defined. Please set it to the path of your libFuzzer.a.")
endif()

if(NOT DEFINED FUZZ_TIMEOUT_SEC)
set(FUZZ_TIMEOUT_SEC 60)
endif()
Expand Down Expand Up @@ -655,8 +651,7 @@ if (BUILD_TESTING)
)
target_link_libraries(${TEST_NAME} PRIVATE
fuzztest
${LIBFUZZER_LIB} # Manually link old libFuzzer.a
-lstdc++
-fsanitize=fuzzer -lstdc++
)

# Set the output directory for the fuzzing binaries
Expand Down
3 changes: 1 addition & 2 deletions codebuild/spec/buildspec_fuzz.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ phases:
- |
cmake . -Bbuild \
-DCMAKE_PREFIX_PATH=$LIBCRYPTO_ROOT \
-DS2N_FUZZ_TEST=on \
-DLIBFUZZER_LIB=/usr/local/libfuzzer/lib/libFuzzer.a
-DS2N_FUZZ_TEST=on
- cmake --build ./build -- -j $(nproc)
post_build:
on-failure: ABORT
Expand Down

0 comments on commit 341a69e

Please sign in to comment.