[Top][All Lists]

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

RE: building static on AIX

From: Howard Chu
Subject: RE: building static on AIX
Date: Mon, 18 Mar 2002 07:49:55 -0800

> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf Of
> Samuel Meder

> On Mon, 18 Mar 2002, Robert Boehne wrote:
> > Under AIX, both shared and static libraries are
> > named lib*.a, so by default we don't build static
> > libraries, i.e. you get one or the other.  When the
> > library is shared, the archvie file contains one
> > member, the shared library.  This is how shared
> > libraries are typically done under AIX, if you're having
> > some problem with it, it isn't becuase it "just doesn't work".
> I'm aware of the above, let me restate my email in a more verbose way.
> The problem I was running into occured when I tried to use libtool
> with the -static flag (which if I understand things correctly should
> create static libs). This would cause empty libraries to be created
> (all the object files got created correctly, but when libtool was
> called in link mode something like 'ar cru libfoo.a' would happen (ie
> no object files were specified on the ar line). 
> To make static building work I had to supply the --disable-shared
> option at configure time. My main complaint/suggestion concerning
> the above was that I'd be nice if libtool either worked or returned a
> reasonable error when the -static option is specified, but libtool
> isn't configured to generate static libs by default (ie I don't like
> the behavior where it looks like it's working, but in fact only
> creates empty libraries).
> Hope that explains it better

Something else to keep in mind; on AIX there is no reason to build
static libraries since the linker can perform static links using shared
objects as input. So for this case, "-static" should be a silent no-op
and libtool should just continue to build a shared library. (Moreover,
the AIX linker executes a lot faster with shared objects as input, and
yes, it's smart enough to extract just the pieces it needs, it won't pull
in the entire object file on a static link.)

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun     
  Symas: Premier OpenSource Development and Support 

reply via email to

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