This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add -print-lto-plugin
"H.J. Lu" <hjl.tools@gmail.com> writes:
> On Sat, Oct 2, 2010 at 8:41 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>> On Sat, Oct 2, 2010 at 2:24 PM, Andi Kleen <andi@firstfloor.org> wrote:
>>> From: Andi Kleen <ak@linux.intel.com>
>>>
>>> binutils have LTO linker plugin support now, but it requires hardcoding
>>> the path to gcc's libexec dir in the Makefile. Add an option to the
>>> gcc driver instead to print the full file name to avoid this.
>>>
>>
>>
>> It sounds wrong to me. Linker shouldn't hardcode the path to
>> gcc's libexec, which should be passed down to linker from gcc.
>
> If you are referring to "ar --plugin", gcc-ar or something like it
> works better.
ar, ranlib and nm yes.
Are you suggesting to add standard gcc-ar / gcc-ranlib
wrappers to gcc?
If that's the consensus I can do that, but personally
ar --plugin `gcc -print-lto-plugin` seems better for me.
[That is there is still a bug in binutils that you
always have to set GNUTARGET=plugin too, but I hope that
will get eventually fixed]
The advantage of the option that it dynamically adapts to different CCs
passed into Makefiles. With the separate wrapper I would always need to
pass a special ar and ranlib too for different compiler versions. I do
that today and it's somewhat annoying to type.
And another advantage is that it doesn't mess with command line
completion for "gcc".
-Andi
--
ak@linux.intel.com -- Speaking for myself only.