Skip to content

Commit

Permalink
oss-fuzzshark: fix linking issues due to register_all_protocols() rem…
Browse files Browse the repository at this point in the history
…oved from -lepan

During compilation of oss-fuzzshark (google/oss-fuzz#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 [b695b3e]
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>
  • Loading branch information
jwzawadzki committed Nov 21, 2017
1 parent 0b2eccc commit 2ad1507
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/oss-fuzzshark/build.sh
Expand Up @@ -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}

Expand All @@ -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
Expand Down

0 comments on commit 2ad1507

Please sign in to comment.