[Top][All Lists]

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

Re: $whole_archive_flag_spec and AIX

From: Robert Boehne
Subject: Re: $whole_archive_flag_spec and AIX
Date: Thu, 10 May 2001 12:32:15 -0500

address@hidden wrote:
> I think the proper way to get $whole_archive_flag_spec set for AIX is
> to use the -bnogc option or one of its equivalents. The
> whole_archive_flag_spec variable is set for Solaris as follows (1.4):
>   whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
> Looking at ld(1) for AIX, I cannot find an equivalent command. We have:
>   -bnogc        Turn off garbage collection for all objects
>                 being linked in
>   -bgcbypass:#  Turn off garbage collection for # many files
>                 following this option
>   -bkeepfile:F  Turn off garbage collection for file `F'
> I tried -bnogc and -bgc to determine if object files inbetween them
> would not have garbage collection activated but these flags apply to
> all objects on the command line. I think I could set
> whole_archive_flag_spec in such a way as to split $convenience into
> space-separated filenames and pass that through wc to get the number
> of object files allowing us to use -bgcbypass. Two solutions using
> this method:
>   whole_archive_flag_spec='-bgcbypass:`echo $convenience |
>   tr ' ' '\012' | wc -l` $convenience'
>   whole_archive_flag_spec='-bgcbypass:`set -- \`echo $convenience\`;
>   echo $#` $convenience'
> Look like an acceptable solution? The only problem with this is if
> files in $convenience have spaces in the filename. But the Solaris
> solution above has the same problem.
> --
> albert chin (address@hidden)


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?  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.

Do you hate the AIX linker as much as I do?  ;)


Robert Boehne             Software Engineer
Ricardo Software   Chicago Technical Center
TEL: (630)789-0003 x. 238
FAX: (630)789-0127
email:  address@hidden

reply via email to

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