RFR: JDK-8217723 Switch ld from bfd to gold on gcc toolchain

Volker Simonis volker.simonis at gmail.com
Tue Jan 29 15:23:58 UTC 2019


When I last tried gold a few years ago on ppc64 (and ia64, just for
the reference :) it didn't work because it didn't support all the
required relocations.

However, a current experiment with "GNU gold (GNU Binutils for Ubuntu
2.26.1) 1.11" on Ubuntu 16.04/ppc64le succeeded and improved the link
time of libjvm.so (with full debug info) from ~15 to ~5 seconds which
is pretty nice.

I'd still appreciate if the usage of gold would be guarded by a configure check.

Thank you and best regards,
Volker

On Sat, Jan 26, 2019 at 6:00 PM Martin Buchholz <martinrb at google.com> wrote:
>
> Another, more productionized, version of my benchmark:
>
> processors=12
> g++ (Debian 7.3.0-5) 7.3.0
> --- -fuse-ld=bfd ---
> 6.559 user 1.180 system 7.740 total
> --- -fuse-ld=gold ---
> 4.575 user 0.600 system 5.176 total
> --- -fuse-ld=gold -Wl,-threads ---
> 9.355 user 5.062 system 4.289 total
> --- -fuse-ld=lld ---
> 2.700 user 1.058 system 1.157 total
> --- -fuse-ld=lld -Wl,-threads ---
> 2.572 user 1.128 system 1.107 total
>
>
> #!/bin/bash
> set -eu
> echo processors=$(nproc)
> read -a CMDLINE < $(find . -name BUILD_LIBJVM_link.cmdline -print)
>
> readonly DRIVER="${CMDLINE[0]}"
> "$DRIVER" --version | head -1
>
> benchmark() {
>   echo --- "$@" ---
>   local -r TIMEFORMAT="%U user %S system %R total"
>   time "$DRIVER" "$@" "${CMDLINE[@]:1}"
> }
>
> benchmark -fuse-ld=bfd
> benchmark -fuse-ld=gold
> benchmark -fuse-ld=gold -Wl,-threads
> benchmark -fuse-ld=lld
> benchmark -fuse-ld=lld -Wl,-threads



More information about the build-dev mailing list