LD Changes To Implicit DSO Linking Update

Gerd Hoffmann kraxel at redhat.com
Tue Feb 16 15:23:18 UTC 2010

On 02/16/10 16:06, Jakub Jelinek wrote:
> On Tue, Feb 16, 2010 at 03:57:52PM +0100, Gerd Hoffmann wrote:
>> Well.  Even pretty fundamental GNOME stuff like gtk2-devel is still
>> broken.  Look here:
>> [root at localhost ~]# pkg-config --libs gtk+-2.0
>> -pthread -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0
>> -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lcairo -lpango-1.0 -lfreetype
>> -lfontconfig -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lrt -lglib-2.0
>> -lX11 is missing (at least, maybe more).  Any gtk app using pkg-config
>> to figure which libraries are required fails to build now.
> Only if the library you are compiling actually uses any libX11 APIs.
> If it only uses APIs from the named libraries, it will link fine.

Sure?  For the libpng case I have a build failure which looks like this 
isn't the case (bug 565047):

/usr/bin/ld: /usr/lib/gcc/i686-redhat-linux/4.4.3/../../../libpng12.so: 
undefined reference to symbol 'crc32'
/usr/bin/ld: note: 'crc32' is defined in DSO /lib/libz.so.1 so try 
adding it to the linker command line

Which made me think -lz is needed on the command line even if zlib is 
used only indirectly via libpng (and likewise that -lX11 should be there 
for gtk2 because gtk2 needs it).


More information about the devel mailing list