Skip to content

Commit

Permalink
[Fuzzing] add
Browse files Browse the repository at this point in the history
Signed-off-by: Arjun Singh <[email protected]>
  • Loading branch information
0x34d committed Oct 20, 2023
1 parent 9c03f8e commit e93e1a7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,6 @@ if(BUILD_FUZZ_TESTS)
target_link_libraries(${target} brpc-static-debug ${LIB_FUZZING_ENGINE})
set_target_properties(${target} PROPERTIES
BUILD_WITH_INSTALL_RPATH TRUE
INSTALL_RPATH "$ORIGIN/../lib")
INSTALL_RPATH "$ORIGIN/lib")
endforeach()
endif()
8 changes: 5 additions & 3 deletions test/fuzzing/oss-fuzz.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ cmake \
-DCMAKE_C_COMPILER="$CC" -DCMAKE_CXX_COMPILER="$CXX" \
-DCMAKE_C_FLAGS="$CFLAGS" -DCMAKE_CXX_FLAGS="$CFLAGS" -DCMAKE_CPP_FLAGS="$CFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS="$CFLAGS" -DLIB_FUZZING_ENGINE="$LIB_FUZZING_ENGINE" \
-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DBUILD_UNIT_TESTS=ON -DBUILD_FUZZ_TESTS=ON ../.
-DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DWITH_SNAPPY=ON -DBUILD_UNIT_TESTS=ON -DBUILD_FUZZ_TESTS=ON ../.

# https://github.com/google/oss-fuzz/pull/10898
make fuzz_butil fuzz_esp fuzz_hpack fuzz_http fuzz_hulu fuzz_json fuzz_redis fuzz_shead fuzz_sofa fuzz_uri --ignore-errors
make \
fuzz_butil fuzz_esp fuzz_hpack fuzz_http fuzz_hulu fuzz_json \
fuzz_redis fuzz_shead fuzz_sofa fuzz_uri --ignore-errors -j$(nproc)

cp test/fuzz_* $OUT/

pushd /lib/x86_64-linux-gnu/
mkdir $OUT/lib/
mkdir -p $OUT/lib/
cp libgflags* libprotobuf* libleveldb* libprotoc* libsnappy* $OUT/lib/.
popd

0 comments on commit e93e1a7

Please sign in to comment.