From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30024 invoked by alias); 26 Mar 2011 11:13:24 -0000 Received: (qmail 30015 invoked by uid 22791); 26 Mar 2011 11:13:23 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BV X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Mar 2011 11:13:18 +0000 Received: by wye20 with SMTP id 20so1309794wye.20 for ; Sat, 26 Mar 2011 04:13:17 -0700 (PDT) MIME-Version: 1.0 Received: by 10.227.178.14 with SMTP id bk14mr1783658wbb.102.1301137997682; Sat, 26 Mar 2011 04:13:17 -0700 (PDT) Received: by 10.227.64.142 with HTTP; Sat, 26 Mar 2011 04:13:17 -0700 (PDT) In-Reply-To: References: Date: Sat, 26 Mar 2011 11:15:00 -0000 Message-ID: Subject: Re: [build, lto] Only accept -fuse-linker-plugin if linker supports -plugin (PR lto/46944) From: Richard Guenther To: Michael Matz Cc: gcc-patches@gcc.gnu.org, Rainer Orth , Richard Guenther Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-03/txt/msg01820.txt.bz2 On Sat, Mar 26, 2011 at 3:51 AM, Michael Matz wrote: > Hi, > > [sorry for breaking the threading I've deleted the mails I'm answering > already] > > In any case, citing from > =A0http://gcc.gnu.org/ml/gcc-patches/2011-03/msg01250.html > >> Here's the patch I came up with. =A0It is on top of the previous one, so >> if we want to backport to 4.6 later, both are necessary. >> >> It also fixes a typo in the in_tree_ld case, which can never have >> worked. >> >> Tested by i386-pc-solaris2.11 bootstraps with either Sun ld or gld 2.21, >> and by configuring with Sun ld --with-plugin-ld=3Dgld-2.21 and obvserving >> HAVE_LTO_PLUGIN being set to 1. > ... >> @@ -3207,6 +3207,10 @@ >> =A0 =A0 =A0elif test "$ld_is_gold" =3D yes -a "$ld_vers_major" -eq 2 -a = "$ld_vers_minor" -eq 20; then >> =A0 =A0 =A0 =A0gcc_cv_lto_plugin=3D1 >> =A0 =A0 =A0fi >> + =A0elif test x"$ORIGINAL_PLUGIN_LD_FOR_TARGET" !=3D x"$gcc_cv_ld"; then >> + =A0 =A0# Allow -fuse-linker-plugin if plugin linker differs from >> + =A0 =A0# default/specified linker. >> + =A0 =A0gcc_cv_lto_plugin=3D1 >> =A0 =A0fi >> =A0fi > > And this '1' is a problem. =A0Even if I specify > --with-plugin-ld=3Dsome-good-ld (i.e. it can be reasonably assumed that I > know what I'm doing) the above forces me to still have to use > -fuse-linker-plugin when I really want to use it. =A0This is because the > introduction of three levels of HAVE_LTO_PLUGIN: 0 (-fuse-linker-plugin > not allowed), 1 (allowed but not default for -flto), 2 (allowed and > default to on with -flto). > > I think if the plugin linker is different from the normal linker we should > set HAVE_LTO_PLUGIN to 2. 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. Richard. > > Ciao, > Michael. >