Ethereal-dev: Re: [ethereal-dev] Re: gtk-1.2.6 + AIX 4.3.2 == coredump

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

From: Craig Rodrigues <rodrigc@xxxxxxxxxxxx>
Date: Sat, 6 Nov 1999 23:29:16 -0500
On Sat, Nov 06, 1999 at 08:38:13PM -0500, Craig Rodrigues wrote:
> (1), and I believe that this is the "incorrect" way to do it.
> 
> On a side note, I still consistently get coredumps in the gdk_check_init()

> 
> So this is my hypothesis.
> gtk_init_check() is in libgtk.a
> gdk_init_check() is in libgdk.a
> 
> If you have a shared object which requires symbols that are in another
> shared object, if you don't do things right, the run-time linker
> will screw things up, and you will segfault.  (The run-time linker
> could be buggy as well).

This hypothesis turned out to be correct.
For some reason, when libgtk is built under AIX, it does not
link libgdk.  So, when gdk_check_init() is called from within
libgtk, the program will segfault, because the reference to
the function cannot be resolved.  It looks like the flags to
link libgdk to libgtk are missing from the Makefile.

This was DAMN tricky to find out, because for some insane reason,
someone decided to include an AIX-specific flag called -berok in libtool.
Under AIX, -berok tells the linker, "if you are linking stuff
together, and you encounter unresolved symbols, don't worry about it,
and build a binary anyways".  So, a binary was being built with
unresolved symbols...and this binary would crash at run-time, because
it was not resolving symbols properly.

libtool is a mess. :)

So I managed to successfully build gtk+ 1.2.6 under AIX 4.3.2.
I will try to accumulate the fixes I made, and submit patches
to the libtool and/or gtk maintainers.

Eesh.  Maybe I can compile ethereal now.
-- 
Craig Rodrigues        
http://www.gis.net/~craigr    
rodrigc@xxxxxxxxxxxx