From patchwork Thu Nov 11 00:08:51 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Klose X-Patchwork-Id: 70734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8A94FB711B for ; Thu, 11 Nov 2010 11:09:27 +1100 (EST) Received: (qmail 32091 invoked by alias); 11 Nov 2010 00:09:22 -0000 Received: (qmail 32072 invoked by uid 22791); 11 Nov 2010 00:09:19 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from adelie.canonical.com (HELO adelie.canonical.com) (91.189.90.139) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 11 Nov 2010 00:09:13 +0000 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PGKin-0004kx-DC; Thu, 11 Nov 2010 00:08:57 +0000 Received: from dslb-088-073-112-050.pools.arcor-ip.net ([88.73.112.50] helo=[192.168.42.17]) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1PGKin-0000Ra-6y; Thu, 11 Nov 2010 00:08:57 +0000 Message-ID: <4CDB3413.1090900@ubuntu.com> Date: Thu, 11 Nov 2010 01:08:51 +0100 From: Matthias Klose User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6 MIME-Version: 1.0 To: Paolo Bonzini , Nick Clifton CC: Mark Mitchell , "Joseph S. Myers" , "H.J. Lu" , Ian Lance Taylor , GCC Patches , binutils Subject: Re: Review of --enable-gold=both patch References: <4C27E695.9070802@codesourcery.com> <4C286200.30402@gnu.org> <4C2886C7.4040408@gnu.org> <4C28CA2A.7060703@codesourcery.com> <4C28CE9C.9030809@gnu.org> <4C28D9F1.6030309@codesourcery.com> <4CC83135.4080603@ubuntu.com> <4CCA91ED.7010909@redhat.com> <4CCAE033.3010009@ubuntu.com> <4CCAE45F.20201@gnu.org> In-Reply-To: <4CCAE45F.20201@gnu.org> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org On 29.10.2010 17:12, Paolo Bonzini wrote: > On 10/29/2010 04:54 PM, Matthias Klose wrote: >> On 29.10.2010 11:20, Nick Clifton wrote: >>> Hi Matthias, >>> >>>>> OK. I suppose we could also have --with-default-linker=gold -- or >>>>> --enable :-) -- but I'm not worried about that. >>>>> >>>>> Thanks again for your help with this. >>>> >>>> the --enable-gold=both option is already in current binutils trunk, >>>> which will soon be released as binutils-2.21. Should this be changed >>>> before the binutils release, or should the binutils patch be kept as it >>>> is? Any recommendations how to update the patch and/or current binutils? >>> >>> We should really make the 2.21 release support --with-default-linker= >>> Would you care to submit a patch for this ? >> >> to summarize: >> >> - in binutils, --with-default-linker= should trigger which linker is >> built, and should determine which linker the ld symlink points to. >> >> - if both linkers are built, the non-default linker build has to be >> enabled with either --enable-ld or --enable-gold. >> >> - values (other than yes or no) passed to --enable-ld and --enable-gold >> are ignored. > > Uh, actually no. Rereading the thread, the only point on which we had consensus > :) was to remove the current wart of --enable-gold disabling --enable-ld; you're > proposing to double it instead. > > This was my proposal: > > --disable-gold [--enable-ld] > Build only ld. Default option. > > --enable-gold[=default] [--enable-ld] > Build both gold and ld. Install gold as "gold" and "ld", install ld > as "ld.bfd". This is different from the current behavior, in that ld > is currently not installed at all. > > --enable-gold[=default] --disable-ld > Build only gold, which is then installed as both "gold" and "ld". > > --enable-gold --enable-ld=default > Build both gold (installed as "gold") and ld (installed as "ld"). > In other words, ld is default > > --enable-gold=default --enable-ld=default > Error. The attached patch implements this proposal, tested the combinations above, and disabling ld without gold (leading to an error). I did choose to always install the bfd linker as ld.bfd and the gold linker as ld.gold, and pointing the link to one of the above. Nick, is this ok with you? Matthias --- binutils-2.20.90.20101105.orig/configure.ac +++ binutils-2.20.90.20101105/configure.ac @@ -321,19 +321,27 @@ yes) skipdirs=`echo " ${skipdirs} " | sed -e 's/ target-newlib / /'` ;; esac -# Handle --enable-gold. -# --enable-gold Build only gold -# --disable-gold [default] Build only ld -# --enable-gold=both Build both gold and ld, ld is default -# --enable-gold=both/ld Same -# --enable-gold=both/gold Build both gold and ld, gold is default, ld is renamed ld.bfd +# Handle --enable-gold, --enable-ld. +# --disable-gold [--enable-ld] +# Build only ld. Default option. +# --enable-gold[=default] [--enable-ld] +# Build both gold and ld. Install gold as "ld.gold" and "ld", +# install ld as "ld.bfd". +# --enable-gold[=default] --disable-ld +# Build only gold, which is then installed as both "ld.gold" and "ld". +# --enable-gold --enable-ld=default +# Build both gold (installed as "ld.gold") and ld (installed as "ld"). +# In other words, ld is default +# --enable-gold=default --enable-ld=default +# Error. +default_ld= AC_ARG_ENABLE(gold, -[[ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]]], +[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]], ENABLE_GOLD=$enableval, ENABLE_GOLD=no) - case "${ENABLE_GOLD}" in - yes|both|both/gold|both/ld) +case "${ENABLE_GOLD}" in + yes|default) # Check for ELF target. is_elf=no case "${target}" in @@ -353,14 +361,10 @@ # Check for target supported by gold. case "${target}" in i?86-*-* | x86_64-*-* | sparc*-*-* | powerpc*-*-* | arm*-*-*) - case "${ENABLE_GOLD}" in - both*) - configdirs="$configdirs gold" - ;; - *) - configdirs=`echo " ${configdirs} " | sed -e 's/ ld / gold /'` - ;; - esac + configdirs="$configdirs gold" + if test x${ENABLE_GOLD} = xdefault; then + default_ld=gold + fi ENABLE_GOLD=yes ;; esac @@ -371,7 +375,31 @@ *) AC_MSG_ERROR([invalid --enable-gold argument]) ;; - esac +esac + +AC_ARG_ENABLE(ld, +[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]], +ENABLE_LD=$enableval, +ENABLE_LD=yes) + +case "${ENABLE_LD}" in + default) + if test x${default_ld} = xgold; then + AC_MSG_ERROR([either gold or ld can be the default ld]) + fi + ;; + yes) + ;; + no) + if test x${ENABLE_GOLD} != xyes; then + AC_MSG_ERROR([gold must be enabled to disable ld]) + fi + configdirs=`echo " ${configdirs} " | sed -e 's/ ld / /'` + ;; + *) + AC_MSG_ERROR([invalid --enable-ld argument]) + ;; +esac # Configure extra directories which are host specific --- binutils-2.20.90.20101105.orig/ld/configure.in +++ binutils-2.20.90.20101105/ld/configure.in @@ -73,13 +73,13 @@ dnl "install_as_default" is set to false if gold is the default linker. dnl "installed_linker" is the installed BFD linker name. AC_ARG_ENABLE(gold, -[[ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]]], +[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]], [case "${enableval}" in - yes|both/gold) + default) install_as_default=no installed_linker=ld.bfd ;; - both|both/ld) + yes|no) install_as_default=yes installed_linker=ld.bfd ;; @@ -87,8 +87,8 @@ AC_MSG_ERROR([invalid --enable-gold argument]) ;; esac], -[install_as_default=ld - installed_linker=ld]) +[install_as_default=yes + installed_linker=ld.bfd]) AC_SUBST(install_as_default) AC_SUBST(installed_linker) --- binutils-2.20.90.20101105.orig/gold/configure.ac +++ binutils-2.20.90.20101105/gold/configure.ac @@ -41,27 +41,33 @@ dnl "install_as_default" is true if the linker to be installed as the dnl default linker, ld. dnl "installed_linker" is the installed gold linker name. -AC_ARG_ENABLE(gold, -[[ --enable-gold[=ARG] build gold [ARG={both}[/{gold,ld}]]]], + +default_ld= +AC_ARG_ENABLE(ld, +[[ --enable-ld[=ARG] build ld [ARG={default,yes,no}]]], [case "${enableval}" in - yes) - install_as_default=gold - installed_linker=ld - ;; - both/gold) - install_as_default=yes + default) + default_ld=ld.bfd + ;; +esac]) + +AC_ARG_ENABLE(gold, +[[ --enable-gold[=ARG] build gold [ARG={default,yes,no}]]], +[case "${enableval}" in + yes|default) + if test x${default_ld} = x; then + install_as_default=yes + fi installed_linker=ld.gold ;; - both|both/ld) - install_as_default=no - installed_linker=ld.gold + no) ;; *) AC_MSG_ERROR([invalid --enable-gold argument]) ;; esac], -[install_as_default=gold - installed_linker=ld]) +[install_as_default=no + installed_linker=ld.gold]) AC_SUBST(install_as_default) AC_SUBST(installed_linker)