Add gcc-ar, gcc-nm, gcc-ranlib
Paolo Bonzini
bonzini@gnu.org
Thu Dec 2 23:04:00 GMT 2010
> --- /dev/null
> +++ b/gcc/lto/gcc-ar.in
> @@ -0,0 +1,18 @@
> +#!/bin/sh
> +# wrapper for ar with GCC LTO support
> +# requires binutils 2.21+
> +
> +BASE=`readlink -f $0`
Portable?
> +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-prog-name=@LTOPLUGINSONAME@` "$@"
Missing quotes around $AR, $BINDIR/$GCC and @LTOPLUGINSONAME@.
> +NM=${NM:-`"$BINDIR/$GCC" -print-prog-name=nm`}
> +
> +exec $NM --plugin `$BINDIR/$GCC $ARG -print-prog-name=@LTOPLUGINSONAME@` "$@"
Likewise.
> +AR=${AR:-`"$BINDIR/$GCC" -print-prog-name=ar`}
> +
> +exec $AR -s --plugin `$BINDIR/$GCC $ARG -print-prog-name=@LTOPLUGINSONAME@` "$@"
Likewise.
Mentions of the script in the docs would need to say that they are
scripts and so they are not necessarily available on non-POSIX
platforms. Give the amount of duplication, it would probably have
been easiest to do in C, I still believe.
Paolo
More information about the Gcc-patches
mailing list