[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
libtool not hardlinking library path on sparc*-sun-solaris*
From: |
Aleksandar Milivojevic |
Subject: |
libtool not hardlinking library path on sparc*-sun-solaris* |
Date: |
Thu, 12 Jan 2006 09:49:48 -0600 |
User-agent: |
Internet Messaging Program (IMP) H3 (4.0.4) |
I've a problem with libtool (1.5.22 and the version included with gcc
4.0.2). Platform is sparc*-sun-solaris*. Using gcc 4.0.2. The linker
doesn't seem to influence it (I've had same problem with gcc build that
uses Sun ld and the build that uses Gnu ld).
When creating shared libraries, the library path is not hardcoded into
executable. On Solaris system, this may result in dynamic linker
failing to load dynamic libraries during runtime.
Looking at generated libtool script, it should have been hardcoded
(hardcode_into_libs is correctly set to yes).
For example, if linking shared library (linkmode=lib), this is what I get:
./libtool --mode=link gcc -o libfoo.la -rpath /prefix/lib list-of-files
gcc -shared list-of-files -lc -Wl,-soname -Wl,libfoo.so.0 -o
.libs/libfoo.so.0.0.0
The resulting link command is missing "-Wl,--rpath -Wl,/prefix/lib"
options (example using Gnu ld). Same thing happens when using gcc
configured to use Sun ld. Since libfoo.so is generated using gcc, it
depends on libgcc_s.so which is installed in /prefix/lib (alongside the
remainder of gcc package).
On the other hand, when linking programs (linkmode=prog), everything
works as expected:
./libtool --mode=link gcc -o foo foo.o -rpath /prefix/lib
gcc -o foo foo.o -Wl,--rpath -Wl,/prefix/lib
This is rather annoying problem. Each time I'm generating shared
library, I must fix things manually so that library search path (RPATH
tag) is inserted into the library.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
- libtool not hardlinking library path on sparc*-sun-solaris*,
Aleksandar Milivojevic <=