[Top][All Lists]

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

Re: building libtool libraries for multiple ABIs

From: Albert Chin
Subject: Re: building libtool libraries for multiple ABIs
Date: Wed, 28 Apr 2004 00:24:56 -0500
User-agent: Mutt/1.5.6i

On Tue, Apr 27, 2004 at 04:58:54PM -0500, Tim Mooney wrote:
> What I'm talking about are platforms (like IRIX and Solaris, but more
> recently Linux and Mac OS X) where the OS is capable of running multiple
> types of binaries.  For example, on IRIX you have the "64 bit" ABI and
> the "new 32 bit" ABI (let's forget about the "old 32 bit" ABI).  Libraries
> built for one ABI cannot be linked with objects built for a different ABI,
> so the system has "segregated" library directories and the linker chooses
> the correct library based on either the command line flags it receives or
> the type of the first object file it sees.
> If you want to build and install a local package (take for example GSL,
> the GNU Scientific Library) that builds a library via libtool, what are
> people doing to have the library built for each ABI that a platform may
> support?  Has anyone found a better method than configuring the package,
> building and installing once, then reconfiguring with CFLAGS and LDFLAGS
> set for a different ABI and overridding the library directory, and
> building and installing again?  This can become a pretty tiresome
> process, especially if you also package your local software (such as
> with RPM) and install the package.
> How are other people dealing with this issue?

What other solution is there than rebuilding? When we build software,
we build most packages to a _separate_ directory. So, for GSL, we have
something like /opt/libgsl13 and /opt/libgsl14. When we build 64-bit
versions of these, we build as usual but set
--libdir=/opt/libgsl13/lib/64. Then, when we do an install, we install
_only_ the library (for the 32-bit install we do everything). We do
this when we build a C++ library using the vendor compiler and GCC as
well. Using the vendor C++ compiler, we install to /opt/[package]/lib
and then, for GCC, /opt/[package]/lib/gcc32 (because GCC 3.4
introduces ABI breakage, we'll have /opt/[package]/lib/gcc32 _and_

Note the "lib/64" part is different depending on the platform.
"lib/64" is always a link to the platform-specific name:
  /opt/libgsl13/lib/ppc64       AIX 64-bit
  /opt/libgsl13/lib64           IRIX 64-bit
  /opt/libgsl13/lib/pa20_64     HP-UX 64-bit
  /opt/libgsl13/lib/sparcv9     Solaris 64-bit

We do the same for binaries (in the case of LSOF, you need both 32 and
64-bit depending on the kernel you run for some platforms) and
possibly include files, if the include files are specific to the

albert chin (address@hidden)

reply via email to

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