libtool
[Top][All Lists]
Advanced

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

RE: $whole_archive_flag_spec and AIX


From: Howard Chu
Subject: RE: $whole_archive_flag_spec and AIX
Date: Thu, 10 May 2001 21:00:30 -0700

> -----Original Message-----
> From: address@hidden [mailto:address@hidden Behalf Of
> Robert Boehne

> Albert:
>
> The GNU coding standards don't let you use 'wc' for general Libtool
> code, you may be able to get away with it here if 'wc' is available
> by default on all the machines this code would be used on.  I would
> also like you to look at this from the standpoint of a library
> such that the list of object files is too long for the shell
> to interpret.  From my testing 'wc' won't truncate it's output
> as much as the shell, but we should check for any limits in wc
> under AIX before it gets used.
>   Is it possible to use a relocatable object file
> i.e. 'ld -r manyobjs -o singleobj'
> like an archive file under AIX?

In fact this is THE preferred linking method on AIX. This is the only way to
do what you need and it has the advantage of working portably on every other
Unix system as well.

>  I say this because that may
> give you an easier solution.  Or perhaps you could create
> one object file and then make an archive library from that.
> I'm not sure if AIX will link all code from an object or
> if it does function-level garbage collection.

When you use the -bnogc option it will link everything, no analysis is done.
>
> Do you hate the AIX linker as much as I do?  ;)
>
The AIX linker is a little unusual, but I personally think it was a pretty
cool solution to a dumb problem. The linker supports incremental linking of
any supported object file, meaning you can relink executables just by adding
new .o's to existing executable files. I think .a libraries are pretty
annoying, and this whole notion of sectioning symbol references by "files"
is an incredibly antiquated and detrimental paradigm. The IBM notion of
csects makes so much more sense, separating symbols and objects by
functional units. On AIX you have the freedom of not having to differentiate
between static code and dynamic code, it's all the same. You link a bunch of
.o's into a single .o file and you can use it dynamically or statically at
your option, and if you link statically the linker automatically finds just
the csects you need. You spendfar fewer CPU cycles doing link-time or
run-time relocation because the library's internal references are fully
resolved. This is cool stuff, this is stuff that advances the state of the
art. All linkers should be so smart. The ELF object format allows a linker
to be this smart too, but I haven't seen anybody take advantage of this
capability. The last time I saw a linker like this was the 68000 SVR4 ABI
linker I wrote for my Atari ST.

And before you go off complaining that IBM was stupid to take "Unix" and do
it differently, note that there still are perfectly legitimate ways to run
things that are 100% compatible with every other Unix out there. Of course,
they're rather brain-damaged, but that's what you get for serving the lowest
common denominator.

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc




reply via email to

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