[google] Enable both ld and gold in gcc (issue4664051)

H.J. Lu hjl.tools@gmail.com
Tue Jun 28 16:23:00 GMT 2011


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.



More information about the Gcc-patches mailing list