This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [google] Enable both ld and gold in gcc (issue4664051)
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Diego Novillo <dnovillo at google dot com>
- Cc: Doug Kwan <dougkwan at google dot com>, reply at codereview dot appspotmail dot com, gcc-patches at gcc dot gnu dot org, Nick Clifton <nickc at redhat dot com>, Matthias Klose <doko at debian dot org>
- Date: Tue, 28 Jun 2011 08:49:33 -0700
- Subject: Re: [google] Enable both ld and gold in gcc (issue4664051)
- References: <20110627230948.7456B20903@atree.mtv.corp.google.com> <4E09C22F.3070609@google.com>
On Tue, Jun 28, 2011 at 4:59 AM, Diego Novillo <dnovillo@google.com> wrote:
> On 11-06-27 19:09 , Doug Kwan wrote:
>>
>> This patch enables both ld and gold in gcc using the -fuse-ld switch. ?The
>> original patch use written by Nick Clifton and was subsequently updated by
>> Matthias Klose. ?The patch currently does not work with LTO but that is
>> okay for now and it is no worse than its counterpart in an older gcc
>> version.
>> We need this functionality for now. ?It is mostly used as a safety net in
>> the
>> Android toolchain if gold does not work. ?We can disable LTO in that case.
>> Hopefully we will fix this can resubmit it for trunk later.
>>
>> This is tested by running ./buildit and building the Android toolchain.
>>
>> I would like to apply this to goolge/main only.
>>
>> 2011-06-27 ? Doug Kwan<dougkwan@google.com>
>>
>> ? ? ? ?Google ref 41164-p2
>> ? ? ? ?Backport upstream patch under review.
>>
>> ? ? ? ?2011-01-19 ? Nick Clifton<nickc@redhat.com>
>> ? ? ? ? ? ? ? ? ? ? ? ?Matthias Klose<doko@debian.org>
>>
>> ? ? ? ? ? ? ? ?* configure.ac (gcc_cv_gold_srcdir): New cached variable -
>> ? ? ? ? ? ? ? ?contains the location of the gold sources.
>> ? ? ? ? ? ? ? ?(ORIGINAL_GOLD_FOR_TARGET): New substituted variable -
>> contains
>> ? ? ? ? ? ? ? ?the name of the locally built gold executable.
>> ? ? ? ? ? ? ? ?* configure: Regenerate.
>> ? ? ? ? ? ? ? ?* collect2.c (main): Detect the -use-gold and -use-ld
>> switches
>> ? ? ? ? ? ? ? ?and select the appropriate linker, if found.
>> ? ? ? ? ? ? ? ?If a linker cannot be found and collect2 is executing in
>> ? ? ? ? ? ? ? ?verbose mode then report the search paths examined.
>> ? ? ? ? ? ? ? ?* exec-tool.in: Detect the -use-gold and -use-ld switches
>> and
>> ? ? ? ? ? ? ? ?select the appropriate linker, if found.
>> ? ? ? ? ? ? ? ?Add support for -v switch.
>> ? ? ? ? ? ? ? ?Report problems locating linker executable.
>> ? ? ? ? ? ? ? ?* gcc.c (LINK_COMMAND_SPEC): Translate -fuse-ld=gold into
>> ? ? ? ? ? ? ? ?-use-gold and -fuse-ld=bfd into -use-ld.
>> ? ? ? ? ? ? ? ?* common.opt: Add fuse-ld=gold and fuse-ld=bfd.
>> ? ? ? ? ? ? ? ?* opts.c (comman_handle_option): Ignore -fuse-ld=gold and
>> ? ? ? ? ? ? ? ?-fuse-ld=bfd.
>> ? ? ? ? ? ? ? ?* doc/invoke.texi: Document the new options.
>
> OK for google/main.
>
> Nick/Matthias, anything in particular blocking this patch in trunk? (other
> than the LTO issue)
>
For gcc, ld.bfd and ld.gold are interchangeable.
--
H.J.