[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gobolinux-users
Subject:    Re: [gobolinux-users] Serious problem with shared libraries
From:       "Lucas C. Villa Real" <lucasvr () gobolinux ! org>
Date:       2008-11-27 5:38:06
Message-ID: 2c03f9590811262138u5d71391cxa297327be422cbc1 () mail ! gmail ! com
[Download RAW message or body]

On Sat, Nov 22, 2008 at 1:31 PM, Zbigniew Baniewski <zb@ispid.com.pl> wrote:
> Hallo,
>
> I've got a problem with shared libraries: I wanted to compile a program,
> that needed newer version of Cairo library. That version - from the other
> side - demanded newer version of Xorg libraries (now it's Xorg-Lib 7.4). And
> that made a problem: every application, which is using Athena widgets
> library - like xterm, for example - refuses to work, saying something like
> that:
>
>  xterm: error while loading shared libraries: libXaw8.so.8: cannot open
>  shared object file: No such file or directory
>
> Taking a look into ld.so.cache I can see, that there's mentioned symlink to
> libXaw8.so.8, under the name libXaw.so.8. But - from unknown reason - the
> application's binary has the name libXaw8.so.8 "hardcoded". There is a
> proper symbolic link in /System/Links/Libraries, looking like that:
>
>  libXaw8.so.8 -> /Programs/Xorg-Lib/7.4/lib/libXaw8.so.8.0.0
>
> I made a comparison with my Debian installation, and I found out, that their
> binaries have the s.c. SONAME hardcoded (like mentioned libXaw.so.8), and
> that AFAIK has been especially designed to avoid such problems, like mine
> (a very specific version of the library needed by the application).
> Unfortunately, my tries to recompile always ended with hardcoding the name
> libXaw8.so.8 into the binary.
>
> The library itself seems to be properly built:
>
>  objdump -p /Programs/Xorg-Lib/7.4/lib/libXaw8.so.8.0.0 | grep SONAME
>
>  SONAME      libXaw.so.8
>
> Running "ldconfig" to rebuild the cache didn't help; it's just skipping
> the name libXaw8.so.8, leaving only libXaw.so.8 in the cache file. Now
> I'm unable to use any xterm, neither any other "Athena widgets"-based
> application. And I don't know, is it the only(?) library, that I've got
> such problem with...
>
> Perhaps someone could tell me:
>
> 1. Why compilation in Gobolinux environment forces the real name of the
>   library (at least that libXaw8.so.8) to be hardcoded in the resulting
>   binary?

There's nothing special in GoboLinux environment that should force
that.. It's quite interesting, however, that I also have that problem
here with XTerm 224. It seems I never tried to use xterm in this setup
before:

xterm: error while loading shared libraries: libXaw8.so.8: cannot open
shared object file: No such file or directory

I also do have a valid symlink named libXaw8.so.8 in
/System/Links/Libraries. The output from strace is quite interesting,
though:

[...]
open("/System/Links/Libraries/libXrender.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\340\23"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=36668, ...}) = 0
mmap2(NULL, 29352, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3,
0) = 0xb7d3e000
mmap2(0xb7d45000, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x7) = 0xb7d45000
close(3)                                = 0

open("/Programs/Glibc/2.5/lib/tls/i686/sse2/libXaw8.so.8", O_RDONLY) =
-1 ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/tls/i686/sse2", 0xbf8291b8) = -1
ENOENT (No such file or directory)
open("/Programs/Glibc/2.5/lib/tls/i686/libXaw8.so.8", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/tls/i686", 0xbf8291b8) = -1 ENOENT (No
such file or directory)
open("/Programs/Glibc/2.5/lib/tls/sse2/libXaw8.so.8", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/tls/sse2", 0xbf8291b8) = -1 ENOENT (No
such file or directory)
open("/Programs/Glibc/2.5/lib/tls/libXaw8.so.8", O_RDONLY) = -1 ENOENT
(No such file or directory)
stat64("/Programs/Glibc/2.5/lib/tls", 0xbf8291b8) = -1 ENOENT (No such
file or directory)
open("/Programs/Glibc/2.5/lib/i686/sse2/libXaw8.so.8", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/i686/sse2", 0xbf8291b8) = -1 ENOENT
(No such file or directory)
open("/Programs/Glibc/2.5/lib/i686/libXaw8.so.8", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/i686", 0xbf8291b8) = -1 ENOENT (No
such file or directory)
open("/Programs/Glibc/2.5/lib/sse2/libXaw8.so.8", O_RDONLY) = -1
ENOENT (No such file or directory)
stat64("/Programs/Glibc/2.5/lib/sse2", 0xbf8291b8) = -1 ENOENT (No
such file or directory)
open("/Programs/Glibc/2.5/lib/libXaw8.so.8", O_RDONLY) = -1 ENOENT (No
such file or directory)
stat64("/Programs/Glibc/2.5/lib", {st_mode=S_IFDIR|0775, st_size=2984, ...}) = 0
writev(2, [{"xterm", 5}, {": ", 2}, {"error while loading shared
libra"..., 36}, {": ", 2}, {"libXaw8.so.8", 12}, {": ", 2}, {"cannot
open shared object file", 30}, {": ", 2}, {"No such file or
directory", 25}, {"\n", 1}], 10xterm: error while loading shared
libraries: libXaw8.so.8: cannot open shared object file: No such file
or directory
) = 117

At the top you can see that libXrender.so.1 was searched in
/System/Links/Libraries. However, when libXaw8.so.8 was needed, only
/Programs/Glibc/2.5 was scanned for that lib.

> 2. How can I fix the problem, but in clean, elegant way - I mean: to make it
>   use SONAME, instead of hardcoding the real library name?
>
> Currently I'm using gcc version 4.3.2 (GCC) with Glibc 2.8.

Just recompiling XTerm solved the issue to me. I'm not sure of other
possible fixes, though.

Lucas
_______________________________________________
gobolinux-users mailing list
gobolinux-users@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic