Wireshark-bugs: [Wireshark-bugs] [Bug 1677] wireshark-0.99.6 does not compiles with --as-needed
Date: Tue, 11 Dec 2007 13:33:44 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1677


pva@xxxxxxxxxx changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |




------- Comment #5 from pva@xxxxxxxxxx  2007-12-11 13:33 GMT -------
 Jeff, I see still same errors with your patch:

rm -f .libs/dftestS.c .libs/dftest.nm .libs/dftest.nmS .libs/dftest.nmT
i686-pc-linux-gnu-gcc "-D_U_=__attribute__((unused))" -O2 -mtune=pentium-m
-fomit-frame-pointer -mcpu=pentium-m -pipe -Wall -W
-Wdeclaration-after-statement -Wendif-labels -Wpointer-arith -Wno-pointer-sign
-I/usr/local/include -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include
-I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0
-I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2
-I/usr/include/libpng12 -Wl,--as-needed -o .libs/dftest dftest.o util.o
.libs/dftestS.o -Wl,--export-dynamic  -L/usr/local/lib
wiretap/.libs/libwiretap.so epan/.libs/libwireshark.so -L/usr/lib -lcrypto
/usr/lib/libpcre.so /usr/lib/libgmodule-2.0.so -ldl /usr/lib/libglib-2.0.so -lm
-lpcap /usr/lib/libgnutls.so /usr/lib/libtasn1.so /usr/lib/libgcrypt.so -lnsl
/usr/lib/libgpg-error.so -lz
epan/.libs/libwireshark.so: undefined reference to `mpa_padding'
epan/.libs/libwireshark.so: undefined reference to `mpa_layer'
epan/.libs/libwireshark.so: undefined reference to
`wtap_pcap_encap_to_wtap_encap'
epan/.libs/libwireshark.so: undefined reference to `mpa_frequency'
epan/.libs/libwireshark.so: undefined reference to `mpa_version'
epan/.libs/libwireshark.so: undefined reference to `mpa_samples'
epan/.libs/libwireshark.so: undefined reference to `mpa_bitrate'
collect2: ld returned 1 exit status
make[2]: *** [dftest] Error 1
make[2]: Leaving directory
`/var/tmp/portage/net-analyzer/wireshark-0.99.7_pre2/work/wireshark-0.99.7pre2'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/var/tmp/portage/net-analyzer/wireshark-0.99.7_pre2/work/wireshark-0.99.7pre2'
make: *** [all] Error 2


The problem as I understood it now is that after linking
epan/.libs/libwireshark.so still misses symbols from wiretap:

 $ readelf -Ws epan/.libs/libwireshark.so | grep 'mpa_padding'
        64: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND mpa_padding
131009: 00000000     0 NOTYPE  GLOBAL DEFAULT  UND mpa_padding

And that's Ok as this is DSO which could have UND symbols. But this DSO should
contain dependency on libwiretap.so, which is missed:

$ ldd epan/.libs/libwireshark.so
        libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0xb6565000)
        libdl.so.2 => /lib/libdl.so.2 (0xb6561000)
        libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb64a0000)
        libpcre.so.0 => /usr/lib/libpcre.so.0 (0xb6478000)
        libgnutls.so.13 => /usr/lib/libgnutls.so.13 (0xb6408000)
        libtasn1.so.3 => /usr/lib/libtasn1.so.3 (0xb63f7000)
        libgcrypt.so.11 => /usr/lib/libgcrypt.so.11 (0xb63a7000)
        libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0xb63a2000)
        libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0xb6256000)
        libm.so.6 => /lib/libm.so.6 (0xb6231000)
        libz.so.1 => /lib/libz.so.1 (0xb621e000)
        libpthread.so.0 => /lib/libpthread.so.0 (0xb6207000)
        libc.so.6 => /lib/libc.so.6 (0xb60d5000)
        /lib/ld-linux.so.2 (0x80000000)
        libnsl.so.1 => /lib/libnsl.so.1 (0xb60be000)

You see, no wiretap in the output. And this is what is broken here. And that's
why linker does not manage to find that symbols. Thank you for your attention.


-- 
Configure bugmail: http://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.