Ethereal-dev: Re: [Ethereal-dev] Please test: shared libs

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Sun, 8 Feb 2004 15:08:32 -0800
On Fri, Feb 06, 2004 at 03:42:23PM -0800, Guy Harris wrote:
> Let me (or somebody) test it on, at minimum, Mac OS X *and* Solaris 
> first,

I installed autoconf 2.52, automake 1.6, and libtool 1.5 on my Solaris
partition (automake 1.5 blew up with some weird problems, but 1.6
didn't; 1.6 requires a minimum of autoconf 2.52).

I was able to run autogen.sh and configure; however, when I tried to
build, I got:

	/bin/sh ./libtool --mode=link gcc -D_U_="__attribute__((unused))"
	    -Wall -W -g -O2 -I/usr/local/include
	    -I/usr/local/lib/glib/include -I/usr/local/include -o
	    libethereal.la -rpath /usr/local/lib -version-info 0:1:0
	    atalk-utils.lo bitswap.lo circuit.lo conversation.lo
	    column-utils.lo epan.lo except.lo filesystem.lo frame_data.lo
	    int-64bit.lo ipv4.lo osi-utils.lo packet.lo plugins.lo proto.lo
	    resolv.lo sna-utils.lo strutil.lo to_str.lo tvbuff.lo
	    value_string.lo inet_aton.o inet_pton.o inet_ntop.o
	    ftypes/libftypes.a -L/usr/local/lib -R/usr/local/lib -lgmodule
	    -lglib -ldl

	*** Warning: Linking the shared library libethereal.la against the
	*** static library ftypes/libftypes.a is not portable!

	*** Warning: Linking the shared library libethereal.la against the non-libtool
	*** objects  inet_aton.o inet_pton.o inet_ntop.o is not portable!
	gcc -shared -Wl,-h -Wl,libethereal.so.0 -o .libs/libethereal.so.0.0.1  .libs/atalk-utils.o .libs/bitswap.o .libs/circuit.o .libs/conversation.o .libs/column-utils.o .libs/epan.o .libs/except.o .libs/filesystem.o .libs/frame_data.o .libs/int-64bit.o .libs/ipv4.o .libs/osi-utils.o .libs/packet.o .libs/plugins.o .libs/proto.o .libs/resolv.o .libs/sna-utils.o .libs/strutil.o .libs/to_str.o .libs/tvbuff.o .libs/value_string.o  inet_aton.o inet_pton.o inet_ntop.o  -R/usr/local/lib -R/usr/local/lib ftypes/libftypes.a -L/usr/local/lib /usr/local/lib/libgmodule.so /usr/local/lib/libglib.so -ldl -lc 
	Text relocation remains                 	referenced
	    against symbol		    offset	in file
	__huge_val                          0x9a      	ftypes/libftypes.a(ftype-double.o)
	strstr                              0x314     	ftypes/libftypes.a(ftype-string.o)
	g_memdup                            0xad      	ftypes/libftypes.a(ftype-tvbuff.o)
	g_memdup                            0x141     	ftypes/libftypes.a(ftype-tvbuff.o)
	sprintf                             0xc8      	ftypes/libftypes.a(ftype-bytes.o)

		...

It appears that the ftypes stuff is *NOT* being built with "-fPIC",
unlike the top-level libethereal stuff; I would not be surprised to find
that, on Solaris, mixing PIC and non-PIC code in a shared library
doesn't work.  (All shared object code in Solaris - and probably most if
not other all systems using SunOS 4.x/SVR4-style run-time linking, such
as most if not all Linux distributions, and
{Free,Net,Open,Dragonfly}BSD - is supposed to be position-independent
code.)

Speaking of position-independent code, note that making libethereal PIC
will slow down performance somewhat, and making the dissectors PIC will
do so even more.  I don't know how much - as I remember from my SunOS
4.x days, the claim was that it was about a 10% performance hit.