Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tlug: gtk-config



On Wed, 13 Jan 1999, Stephen J. Turnbull wrote:

> LD_LIBRARY_PATH gets checked before the standard library path.  It's
> important for the libc5 compatibility mechanism that the 1.0.5 .so be
> in the path _before_ 1.1.9; apps needing >= 1.1.2 will reject the
> so.1.0.5 and continuing searching.  If 1.1.9 comes first, libc5 apps
> will try to use it and blooey.

ld.so takes into account explicit libc linkage, as well.  If the shared
library was built with -lc on the link line, ld.so will know precisely
when it should and should not use this library (for recent versions of
ld.so, anyway).

I'll use the TL netscape binary as an example:

[chris@example.com chris]$ ldd /usr/lib/netscape-4.07/netscape
        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x40006000)
        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x4004e000)
        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x40057000)
        libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x4006f000)
        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x40081000)
        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x40090000)
        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4009c000)
        libdl.so.1 => /lib/libdl.so.1 (0x40141000)
        libc.so.5 => /lib/libc.so.5 (0x40144000)
        libg++.so.27 => /usr/lib/libg++.so.27 (0x4021b000)
        libstdc++.so.27 => /usr/lib/libstdc++.so.27 (0x4024f000)
        libm.so.5 => /lib/libm.so.5 (0x4027e000)
        libc.so.6 => /lib/libc.so.6 (0x40287000)
        /lib/ld-linux.so.1 => /lib/ld-linux.so.2 (0x00000000)

See that?  Both libc.so.5 _and_ libc.so.6 are being pulled in.  This is
happening because neither the libc.so.5 or the libc.so.6 compat X
libraries were built with an explicit -lc, so ld.so assumes that the
libc.so.6 libraries work with libc.so.5.  Chaos ensues.

Scott 'fixes' this with a LD_LIBRARY_PRELOAD/LD_LIBRARY_PATH bit in the
wrapper, I think.

-- Chris

-------------------------------------------------------------------
Next Nomikai: 14 January 1999, 19:30 Tengu TokyoEkiMae 03-3275-3691
*** it will will be Jan 14 (Thu), as Jan 15 (Fri) is a natl holiday
Next Technical Meeting: Feb 13 (Sat), 12:30    ace: Temple Univ.
-------------------------------------------------------------------
more info: http://tlug.linux.or.jp                     Sponsor: PHT


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links