RFR: JDK-8217723 Switch ld from bfd to gold on gcc toolchain
Magnus Ihse Bursie
magnus.ihse.bursie at oracle.com
Thu Jan 24 13:15:53 UTC 2019
I see now on Wikipedia that gold was added to binutils 2.19.[1] (I
thought it was older still...)
We currently have this check:
TOOLCHAIN_MINIMUM_LD_VERSION_gcc="2.18"
As part of this fix, I ought to bump it to 2.19, so we know for sure
that gold is included.
Volker, would that be a problem for you?
/Magnus
[1] https://en.wikipedia.org/wiki/Gold_(linker)
On 2019-01-24 14:11, Magnus Ihse Bursie wrote:
> The default binutils linker used by gcc, the bfd linker, is slow. The
> new replacement, gold, has been distributed alongside gcc for several
> years now, and is a well mature, and much faster, replacement.
>
> This issue is about replacing ld.bfd with ld.gold for our gcc
> toolchain. In general, this cuts linking times by half or more.
>
> As a future improvement, gold also allows for incremental linking.
> Turning on that is outside the scope of this issue.
>
> Bug: https://bugs.openjdk.java.net/browse/JDK-8217723
> Patch inline:
> diff --git a/make/autoconf/flags-ldflags.m4
> b/make/autoconf/flags-ldflags.m4
> --- a/make/autoconf/flags-ldflags.m4
> +++ b/make/autoconf/flags-ldflags.m4
> @@ -70,7 +70,7 @@
> fi
>
> # Add -z defs, to forbid undefined symbols in object files.
> - BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs"
> + BASIC_LDFLAGS="$BASIC_LDFLAGS -Wl,-z,defs -fuse-ld=gold"
>
> BASIC_LDFLAGS_JVM_ONLY="-Wl,-O1 -Wl,-z,relro"
>
> /Magnus
More information about the build-dev
mailing list