This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers
* Andi Kleen wrote on Fri, Oct 29, 2010 at 04:30:49PM CEST:
> On Fri, Oct 29, 2010 at 04:03:28PM +0200, Andreas Schwab wrote:
> > Andi Kleen <ak@linux.intel.com> writes:
> > > On Fri, Oct 29, 2010 at 01:31:31PM +0000, Joseph S. Myers wrote:
> > >> On Fri, 29 Oct 2010, Andi Kleen wrote:
> > >> > +if test "x$R" != "x" ; then
> > >> > + # work around gold bug, -r and -fuse-linker-plugin
> > >> > + # do not interact well. It's not needed anyways.
> > >> > + # the gold bug has been fixed, but still keep this.
> > >> > + ARGS=`echo $ARGS | sed -e s/-fuse-linker-plugin//`
> > >>
> > >> Apart from the issues with spaces, echo will process some options on some
> > >> systems and this sed command will happily modify option arguments that
> > >> happen to contain that particular string. As before, (POSIX) shell is not
> > >> a good language in which to do this robustly (if you e.g. assume various
> > >> bash features, it becomes easier).
> > >
> > > Are these systems with funny echo supported by LTO?
> >
> > You can do that without echo.
>
> How? I was originally using bash ${../.../..} but I was worried
> that this wasn't portable enough, so i ended up with echo | sed instead.
Go through "$@" with shift and set, and remember that "$@" is the
only array you have in portable shell (and the only way you can get
command-line arguments in a single variable is by quoting each arg by
itself; but in your script this isn't needed at all). Look at the
compile script in toplevel gcc/ to see how it's done; otherwise I can
also write you a portable version of your code tomorrow, iff there is
consensus that a shell version is still desirable.
Cheers,
Ralf
- References:
- Add LTO binutils wrappers
- [PATCH 1/2] Add -print-lto-plugin
- [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers
- Re: [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers
- Re: [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers
- Re: [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers
- Re: [PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers