This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Michael Matz <matz at suse dot de>, gcc-patches at gcc dot gnu dot org, Richard Guenther <rguenther at suse dot de>, Paolo Bonzini <bonzini at gnu dot org>, Ralf Wildenhues <Ralf dot Wildenhues at gmx dot de>
- Date: Mon, 30 May 2011 10:49:42 +0200
- Subject: Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944)
- References: <Pine.LNX.4.64.1103260341510.19760@wotan.suse.de> <AANLkTikOqnfswfmSoGkeEZdMrbaet4UP4BfaSebtAods@mail.gmail.com> <ydd1v1idmcf.fsf@manam.CeBiTec.Uni-Bielefeld.DE>
Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> writes:
> Richard Guenther <richard.guenther@gmail.com> writes:
>
>> I think we should do the linker version checks which relate to linker-plugin
>> use on the plugin-linker instead. So if I specify a separate but known
>> buggy linker I don't want it to be used by default.
>
> Here's a patch that does this. I'm not at all happy with the patch
> since it partially duplicates the logic to determine linker version
> numbers. While this could (and probably should) be generalized along
> the lines of gcc_GAS_CHECK_FEATURE and gcc_GAS_VERSION_GTE_IFELSE, even
> that wouldn't help immediately since such autoconf macros would still
> $gcc_cv_ld. As far as I can see, all those linker checks could
> massively benefit from an overhaul to use gcc_LD_CHECK_FEATURE
> etc.macros, but that's not something I want to attack. It's especially
> messy that there are two sets of version variables for in-tree and
> external linkers. Probably fodder for the build maintainers.
>
> Anyway, here's what I've got. Tested by configuring with
>
> * no --with-ld arg (i.e. /usr/ccs/bin/ld)
>
> * --with-ld=/path/to/gld-2.21 --with-gnu-ld
>
> * --with-plugin-ld=/path/to/gld-2.21
>
> * --with-ld=/path/to/gld-2.21 --with-gnu-ld --with-plugin-ld=/usr/ccs/bin/ld
>
> and checking HAVE_LTO_PLUGIN in auto-host.h (0, 2, 2, 0).
>
> I haven't found if there are provisions for in-tree gold, though, and
> still cannot test that.
[...]
> Could the whole bunch eventually be backported to the 4.6 branch?
>
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00759.html
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01890.html
> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01250.html
>
> and this one?
This question remains: is this series appropriate for the 4.6 branch or
should it stay on mainline only?
> 2011-04-02 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
>
> * configure.ac (gcc_cv_lto_plugin): Determine lto plugin support
> from plugin linker.
> * configure: Regenerate.
This patch has now been approved by Paolo in private mail, installed on
mainline.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University