[Top][All Lists]

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

Re: $whole_archive_flag_spec and AIX

From: libtool
Subject: Re: $whole_archive_flag_spec and AIX
Date: Fri, 11 May 2001 03:24:35 -0500
User-agent: Mutt/1.1.12i

On Thu, May 10, 2001 at 12:32:15PM -0500, Robert Boehne wrote:
> 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)
> > 
> 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'

Yes. I presume manyobjs would be $convenience. And, what if the list
of $convenience files is too long? The above command would fail. I'd
have to make singleobj a temporary file. Problem is, when would the
temp file be removed?

whole_archive_flag_spec is inserted into the link command line.

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

We'd have to rework the way whole_archive_flag_spec is dealt with for
that. I'm hoping I don't have to go that far.

albert chin (address@hidden)

reply via email to

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