ldd/ldconfig problems with Fedora 2 x86_64

From: Roger Davis (rbd_at_planet10.soest.hawaii.edu)
Date: 10/20/04


Date: 19 Oct 2004 23:15:54 GMT


I am having a problem with run-time dynamic library linkage
that I hope someone out there can help me with. I am trying
to install a pre-compiled (no source available!) 3rd-party
app on a dual-Opteron 64-bit Fedora Core 2 platform. This
app is 32-bit and was compiled under RedHat Enterprise 3.
Fedora is unsupported by the app's vendor but we are trying
to make it work for various reasons.

The app requires a few tcl/tk packages, and was originally
compiled against version 8.3.5 of those packages. Fedora 2
uses a newer version (8.4.5). My first cut at doing this
was to install i386 versions of the 8.4.5 packages, as the
app is 32-bit but the system is AMD64 and only the x86_64
64-bit versions of these libraries were installed by the
RedHat installation procedure. (Which, by the way, was told
to install *everything*, so here's a side question --
installing Fedora 2 x86_64 installs many 32-bit libraries,
but not all, e.g., tk/tcl and Motif are among those not
installed. Why are 32-bit versions of some but not all libraries
installed, and what was the criteria for deciding which 32-bit
libraries to install?)

After doing this, ldd verified that the app had no missing
shared libraries, but when I tried to execute it I got a
segmentation fault. I then figured that there must be some
difference between the 8.3.5 and 8.4.5 versions of the tk/tcl
packages, so I installed i386 vesions of the older 8.3.5
packages, and changed symbolic links in /usr/lib to point
to the right place, e.g.,

# cd /usr/lib
# ls -l libtk*
760 -rwxr-xr-x 1 root root 770560 Jun 28 05:35 libtk8.3.so*
  0 lrwxrwxrwx 1 root root 11 Oct 18 11:00 libtk.so.0 -> libtk8.3.so*

After doing this I ran ldconfig, first with no options and then
as 'ldconfig /usr/lib', rebooted and reinstalled the vendor app.
Now when I try to execute the app I get

/opt/vendor/app: error while loading shared libraries: libtk8.4.so: cannot open shared object file: No such file or directory

Looking at it with ldd, I see this:

# ldd /opt/vendor/app
        linux-gate.so.1 => (0xffffe000)

        [ lots of libraries not shown here ... ]

        libtk.so.0 => /usr/lib/libtk.so.0 (0x55759000)
        libtcl.so.0 => /usr/lib/libtcl.so.0 (0x55817000)

        [ more libraries not shown here ... ]

        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x00b12000)
        libstdc++-libc6.2-2.so.3 => /usr/lib/libstdc++-libc6.2-2.so.3 (0x5628f000)
        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x0086c000)
        libtk8.4.so => not found
        libtcl8.4.so => not found

        [ more libraries not shown here ... ]

The good news is that ldd finds /usr/lib/libtk.so.0 and /usr/lib/libtcl.so.0,
which are symbolic links to the desired 8.3.5 libraries. The bad news is
that for some reason the dynamic loader is looking for libtk8.4.so
and libtcl8.4.so! I have no idea why this should be -- I completely
removed all of the tk and tcl 8.4.so files from the system, even the
64-bit versions, and re-ran ldconfig many times, and rebooted, and then
re-installed the app after doing all of the preceding, not to mention that
the app was originally compiled against the 8.3.5 libraries. This is a complete
mystery to me. Here is the proof that there is no libtk8.4.so anywhere
on my machine:

# find / -name '*libtk*' -print
/usr/lib64/libtkx8.3.so
/usr/lib64/libtkstub8.4.a
/usr/lib64/libtkx.so
/usr/lib64/libtkx8.3.a
/usr/lib/libtk.so.0
/usr/lib/libtk8.3.so
/usr/lib/ooo-1.1/program/libtk645li.so
#

It seems that something about the 8.4.5 libraries is cached somewhere
on the system but I'll be damned if I can find it. /etc/ld.so.cache is
hard to examine, but looking at its strings I can find no reference
to libtk8.4.so, and 'ldconfig -p' says

# ldconfig -p | grep libtk
        libtk8.3.so (libc6) => /usr/lib/libtk8.3.so
        libtkx8.3.so (libc6,x86-64) => /usr/lib64/libtkx8.3.so

I am at a complete loss to explain this -- any ideas?

Exactly why does ldd think that my app needs libtk8.4.so? The app was
compiled against libtk8.3.so. Does ldd look only at the executable,
or does it also extract information from the system's cache of dynamic
linkage information?

Is there anything about dynamic linking that is cached anywhere other
than /etc/ld.so.cache? Can I remove that file before running ldconfig,
or will that cause utilities (like ldconfig!) to stop working because
it breaks their dynamic linkages?

Is there a problem here because my system has a mix of 32-bit and 64-bit
libraries? Does the dynamic linker know how to keep all of these things
straight, i.e., properly segregated into 32-bit and 64-bit domains?

Thanks in advance for any help that anyone can offer!

-- 
Roger Davis
University of Hawaii/SOEST
rbd@NoSpamHere.hawaii.edu


Relevant Pages

  • Re: Run 10.20 App on 11.00 ?
    ... installed on both machines using the vendor's install scripts. ... > if the app links in libc.a then you basically up the creek because you have ... Use chatr to see what the dependent libraries are. ... an industrial control system made by Fisher Control Systems. ...
    (comp.sys.hp.hpux)
  • Re: Run 10.20 App on 11.00 ?
    ... installed on both machines using the vendor's install scripts. ... the 11.00 libraries in and you core. ... The area were you get into trouble is where you have a 10.20 app that is ... I would take a close look at the install script. ...
    (comp.sys.hp.hpux)
  • Re: common-lisp-controller vs. asdf-install
    ... I can't find a description where to put libraries ... downloaded manually or by asdf-install. ... If all you want to do is install ASDF based libs for your own use, ... If this is the case you can download and install the library directly by ...
    (comp.lang.lisp)
  • Re: attempt to build 64 bit on Solaris fails
    ... > libraries needed to link with a 64-bit Tk. ... We were running a 32-bit version of Perl ... > Each section below is a summary of the commands used to install it. ...
    (comp.lang.perl.tk)
  • Re: Current status of Ada?
    ... computer magazines I am aware of are for European magazines. ... If the required libraries are not available, ... Can I replace the libc on my Linux system with GNU libc? ... You can, however, install it alongside your existing libc. ...
    (comp.lang.ada)