libtool
[Top][All Lists]
Advanced

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

Re: libtool and 32/64-bit builds


From: Albert Chin
Subject: Re: libtool and 32/64-bit builds
Date: Thu, 25 Jul 2002 14:15:01 -0500
User-agent: Mutt/1.2.5i

On Thu, Jul 11, 2002 at 11:40:56AM -0500, Bob Friesenhahn wrote:
> A number of systems support building both 32 and 64-bit applications.
> For example, Solaris knows to look in the subdirectory 'sparcv9' to
> find 64-bit versions of libraries.  Unfortunately, libtool expands
> libraries that have .la files into a full-path reference to the shared
> library.  This breaks the system linker's library search scheme.  The
> only way I have found to get 64-bit libraries to work with libtool is
> by adding -L and -R options to force libtool to look in the 'sparcv9'
> subdirectory.  Many libtoolized packages are broken in that they don't
> allow the end user to prepend -L and -R options to LDFLAGS so it can
> be difficult to force them to look in a particular directory.

Are you sure that [/64|/sparcv9] is added for user libraries?

$ cat a.c
#include <zlib.h>

int
main (void) {
  const char *version = zlibVersion ();
}
$ cc a.c -lz
$ ldd a.out
        libz.so.1 =>     /usr/lib/libz.so.1
        libc.so.1 =>     /usr/lib/libc.so.1
        libdl.so.1 =>    /usr/lib/libdl.so.1
        /usr/platform/SUNW,Ultra-2/lib/libc_psr.so.1
$ cc -xarch=v9 a.c -lz
$ ldd a.out
        libz.so.1 =>     /usr/lib/64/libz.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        /usr/platform/SUNW,Ultra-2/lib/sparcv9/libc_psr.so.1
$ ls -l /opt/TWWfsw/zlib11/lib
total 318
lrwxrwxrwx   1 root     root           9 Jun 24 22:00 64 -> ./sparcv9
-rw-r--r--   1 root     root       82216 Mar 11 21:31 libz.a
-rwxr-xr-x   1 root     root         693 Mar 11 21:31 libz.la
lrwxrwxrwx   1 root     root          13 Jun 24 22:00 libz.so -> libz.so.2.0.1
lrwxrwxrwx   1 root     root          13 Jun 24 22:00 libz.so.2 -> libz.so.2.0.1
-rwxr-xr-x   1 root     root       74232 Mar 11 21:31 libz.so.2.0.1
drwxr-xr-x   2 root     root         512 Mar 11 21:32 sparcv9
$ ls -l /opt/TWWfsw/zlib11/lib/sparcv9
total 398
-rw-r--r--   1 root     root      103368 Mar 11 21:32 libz.a
-rwxr-xr-x   1 root     root         701 Mar 11 21:32 libz.la
lrwxrwxrwx   1 root     root          13 Jun 24 22:01 libz.so -> libz.so.2.0.1
lrwxrwxrwx   1 root     root          13 Jun 24 22:01 libz.so.2 -> libz.so.2.0.1
-rwxr-xr-x   1 root     root       85224 Mar 11 21:32 libz.so.2.0.1
$ cc -xarch=v9 a.c -L/opt/TWWfsw/zlib11/lib -lz
        libz.so.1 =>     /usr/lib/64/libz.so.1
        libc.so.1 =>     /usr/lib/64/libc.so.1
        libdl.so.1 =>    /usr/lib/64/libdl.so.1
        /usr/platform/SUNW,Ultra-2/lib/sparcv9/libc_psr.so.1

What do you make of this?

-- 
albert chin (address@hidden)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]