Merge pull request #7109 from ethereum/ossfuzz-ci-update

Update fuzzing deps in docker image and ossfuzz CMakeLists.txt
This commit is contained in:
chriseth 2019-07-17 10:51:28 +02:00 committed by GitHub
commit 4fa7800458
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 14 deletions

View File

@ -60,21 +60,23 @@ RUN set -ex; \
ninja install/strip; \ ninja install/strip; \
rm -rf /usr/src/z3 rm -rf /usr/src/z3
# OSSFUZZ: LPM package (do not remove build dirs as solidity compiles/links against that dir) # OSSFUZZ: libprotobuf-mutator
RUN set -ex; \ RUN set -ex; \
mkdir /src; \ git clone https://github.com/google/libprotobuf-mutator.git \
cd /src; \ /usr/src/libprotobuf-mutator; \
git clone https://github.com/google/libprotobuf-mutator.git; \ cd /usr/src/libprotobuf-mutator; \
cd libprotobuf-mutator; \
git checkout d1fe8a7d8ae18f3d454f055eba5213c291986f21; \ git checkout d1fe8a7d8ae18f3d454f055eba5213c291986f21; \
mkdir ../LPM; \ mkdir build; \
cd ../LPM; \ cd build; \
cmake ../libprotobuf-mutator -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON -DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release; \ cmake .. -GNinja -DLIB_PROTO_MUTATOR_DOWNLOAD_PROTOBUF=ON \
-DLIB_PROTO_MUTATOR_TESTING=OFF -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="/usr"; \
ninja; \ ninja; \
cp -vpr external.protobuf/bin/* /usr/bin/; \ cp -vpr external.protobuf/bin/* /usr/bin/; \
cp -vpr external.protobuf/include/* /usr/include/; \ cp -vpr external.protobuf/include/* /usr/include/; \
cp -vpr external.protobuf/lib/* /usr/lib/; \ cp -vpr external.protobuf/lib/* /usr/lib/; \
ninja install/strip ninja install/strip; \
rm -rf /usr/src/libprotobuf-mutator
# OSSFUZZ: libfuzzer # OSSFUZZ: libfuzzer
RUN set -ex; \ RUN set -ex; \

View File

@ -1,6 +1,3 @@
if (OSSFUZZ)
link_directories(/src/LPM/src /src/LPM/src/libfuzzer /src/LPM/external.protobuf/lib)
endif()
add_custom_target(ossfuzz) add_custom_target(ossfuzz)
add_dependencies(ossfuzz add_dependencies(ossfuzz
solc_opt_ossfuzz solc_opt_ossfuzz
@ -37,7 +34,7 @@ if (OSSFUZZ)
target_link_libraries(strictasm_assembly_ossfuzz PRIVATE yul FuzzingEngine.a) target_link_libraries(strictasm_assembly_ossfuzz PRIVATE yul FuzzingEngine.a)
add_executable(yul_proto_ossfuzz yulProtoFuzzer.cpp protoToYul.cpp yulProto.pb.cc) add_executable(yul_proto_ossfuzz yulProtoFuzzer.cpp protoToYul.cpp yulProto.pb.cc)
target_include_directories(yul_proto_ossfuzz PRIVATE /src/libprotobuf-mutator /src/LPM/external.protobuf/include) target_include_directories(yul_proto_ossfuzz PRIVATE /usr/include/libprotobuf-mutator)
target_link_libraries(yul_proto_ossfuzz PRIVATE yul target_link_libraries(yul_proto_ossfuzz PRIVATE yul
protobuf-mutator-libfuzzer.a protobuf-mutator-libfuzzer.a
protobuf-mutator.a protobuf-mutator.a
@ -45,7 +42,7 @@ if (OSSFUZZ)
FuzzingEngine.a) FuzzingEngine.a)
add_executable(yul_proto_diff_ossfuzz yulProto_diff_ossfuzz.cpp yulFuzzerCommon.cpp protoToYul.cpp yulProto.pb.cc) add_executable(yul_proto_diff_ossfuzz yulProto_diff_ossfuzz.cpp yulFuzzerCommon.cpp protoToYul.cpp yulProto.pb.cc)
target_include_directories(yul_proto_diff_ossfuzz PRIVATE /src/libprotobuf-mutator /src/LPM/external.protobuf/include) target_include_directories(yul_proto_diff_ossfuzz PRIVATE /usr/include/libprotobuf-mutator)
target_link_libraries(yul_proto_diff_ossfuzz PRIVATE yul target_link_libraries(yul_proto_diff_ossfuzz PRIVATE yul
yulInterpreter yulInterpreter
protobuf-mutator-libfuzzer.a protobuf-mutator-libfuzzer.a