[PATCH 2/2] Add gcc-ar, gcc-ranlib, gcc-ld wrappers v2

Ralf Wildenhues Ralf.Wildenhues@gmx.de
Fri Oct 29 21:02:00 GMT 2010


* Andi Kleen wrote on Fri, Oct 29, 2010 at 09:03:49PM CEST:
> --- /dev/null
> +++ b/gcc/lto/gcc-ar
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +# wrapper for ar with GCC LTO support
> +# requires binutils 2.21+
> +
> +BASE=`readlink -f $0`
> +BINDIR=`dirname $BASE`
> +
> +if [ -x "$BINDIR/xgcc" ] ; then
> +	GCC=xgcc
> +	ARG=-B$BINDIR
> +else
> +	GCC=gcc
> +	ARG=
> +fi
> +
> +AR=${AR:-`"$BINDIR/$GCC" -print-prog-name=ar`}

> +exec $AR --plugin `$BINDIR/$GCC $ARG -print-lto-plugin` "$@"

If you're double-quoting $BINDIR before in this script for a reason,
then you should do so here as well.  Likewise in the gcc-ranlib script.

Thanks,
Ralf



More information about the Gcc-patches mailing list