This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


On Fri, Oct 29, 2010 at 11:14 AM, Andi Kleen <andi@firstfloor.org> wrote:
> From: Andi Kleen <ak@linux.intel.com>
>
> [Updated version, see changelog below. I decided to drop
> gcc-ld for now because that one seemed to be problematic
> and is only needed for some specific project. I guess I can
> keep it separate.]
>
> Earlier review resulted in a request for having gcc-... wrappers
> to handle the LTO symbol tables for ranlib/ar. This is needed for slim
> lto files, because these tools cannot read the symbol table
> otherwise. Essentially they just call binutils with
> the LTO plugin specified.
>
> Other compilers with LTO support tend to have similar tools.
>
> This patch implements those wrappers.
>
> The wrappers are also needed for a LTO slim of gcc. Right now
> they have to be manually specified for that.
>
> The wrappers require uptodate binutils (the upcoming release)
> with plugin support enabled. ?There is currently no autoconf
> support to detect that. The wrappers query the gcc driver
> in an attempt to handle cross compilation and so naming everywhere
>
> v2: drop gcc-ld for now. support relocated installation trees.
>
> gcc/lto/
>
> 2010-10-26 ?Andi Kleen ?<ak@linux.intel.com>
>
> ? ? ? ?* Make-lang.in (AR_INSTALL_NAME, RANLIB_INSTALL_NAME, LTO_WRAPPERS):
> ? ? ? ?Add.
> ? ? ? ?(lto.all.cross, lto.start.cross): Add dependency to LTO_WRAPPERS.
> ? ? ? ?(lto.install.common): Install wrappers.
> ? ? ? ?(lto.mostlyclean): Clean wrappers.
> ? ? ? ?* gcc-ar, gcc-ranlib.in: Add.
>
> gcc/
>
> 2010-10-26 ?Andi Kleen ?<ak@linux.intel.com>
>
> ? ? ? ?* doc/invoke.texi (gcc-ar, gcc-ranlib): Document.

> diff --git a/gcc/lto/gcc-ranlib b/gcc/lto/gcc-ranlib
> new file mode 100644
> index 0000000..467d593
> --- /dev/null
> +++ b/gcc/lto/gcc-ranlib
> @@ -0,0 +1,7 @@
> +#!/bin/sh
> +# wrapper for ranlib with GCC LTO support
> +
> +BASE=`readlink -f $0`
> +BINDIR=`dirname $BASE`
> +AR=${AR:-`$BINDIR/gcc -print-prog-name=ar`}
> +exec $AR -s --plugin `$GCC_BINDIR/gcc -print-lto-plugin` "$@"
> --
> 1.7.1
>

Did you mean

exec $AR -s --plugin `$BINDIR/gcc -print-lto-plugin` "$@"

Also does it work in the GCC build directory?

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]