oss-fuzzshark: fix linking issues due to register_all_protocols() removed from -lepan

During compilation of oss-fuzzshark (https://github.com/google/oss-fuzz/issues/1003):
Step #3: /src/wireshark/tools/oss-fuzzshark/fuzzshark.c:213: undefined reference to `register_all_protocols'
Step #3: /src/wireshark/tools/oss-fuzzshark/fuzzshark.c:213: undefined reference to `register_all_protocol_handoffs'

After cleanup of make-dissector-reg.py [b695b3e2f7]
these functions are no longer part of epan library (I really wonder why...).
oss-fuzzshark need to compile and link register.c on their own.

Change-Id: I79adf5c1513a0934f140bbf501c181bf14d7619b
Reviewed-on: https://code.wireshark.org/review/24523
Petri-Dish: Jakub Zawadzki <darkjames-ws@darkjames.pl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Jakub Zawadzki <darkjames-ws@darkjames.pl>
This commit is contained in:
Jakub Zawadzki 2017-11-21 18:47:18 +01:00
parent 0b2ecccd86
commit 2ad1507344
1 changed files with 5 additions and 1 deletions

View File

@ -43,7 +43,7 @@ generate_fuzzer()
-c -o $WORK/${fuzzer_name}.o \
$fuzzer_cflags
$CXX $CXXFLAGS $WORK/${fuzzer_name}.o \
$CXX $CXXFLAGS $WORK/register.o $WORK/${fuzzer_name}.o \
-o $OUT/${fuzzer_name} \
${WIRESHARK_FUZZERS_COMMON_FLAGS}
@ -57,6 +57,10 @@ WIRESHARK_FUZZERS_COMMON_FLAGS="-lFuzzingEngine \
-L"$WIRESHARK_INSTALL_PATH/lib" -lwireshark -lwiretap -lwsutil \
-Wl,-Bstatic `pkg-config --libs glib-2.0` -pthread -lpcre -lgcrypt -lgpg-error -lz -Wl,-Bdynamic"
$CC $CFLAGS -I $SRC/wireshark/ `pkg-config --cflags glib-2.0` \
$SRC/wireshark/register.c \
-c -o $WORK/register.o
for dissector in $FUZZ_DISSECTORS; do
generate_fuzzer "${dissector}" -DFUZZ_DISSECTOR_TARGET=\"$dissector\"
done