RFR: JDK-8217723 Switch ld from bfd to gold on gcc toolchain
Erik Joelsson
erik.joelsson at oracle.com
Thu Jan 24 22:28:50 UTC 2019
On 2019-01-24 14:17, Florian Weimer wrote:
> * Martin Buchholz:
>
>> Here's an experiment using the 3 competing open source linkers to link
>> hotspot. This confirms that lld is faster than gold is faster than
>> bfd, but is the one second saving worth the engineering effort?
>>
>> $ (BUILDDIR=$HOME/ws/jdk/build/linux-x86_64-server-release; for
>> linker in bfd gold lld; do echo --- $linker ---; time /usr/bin/g++
>> -fuse-ld=$linker -Wl,--hash-style=both -Wl,-z,defs -Wl,-z,noexecstack
>> -Wl,-O1 -Wl,-z,relro -m64 -static-libstdc++ -static-libgcc -shared
>> -m64 -Wl,-version-script=$BUILDDIR/hotspot/variant-server/libjvm/mapfile
>> -Wl,-soname=libjvm.so -o
>> $BUILDDIR/support/modules_libs/java.base/server/libjvm.so
>> @$BUILDDIR/hotspot/variant-server/libjvm/objs/_BUILD_LIBJVM_objectfilenames.txt
>> -lm -ldl -lpthread; done)
>> --- bfd ---
>> /usr/bin/g++ -fuse-ld=$linker -Wl,--hash-style=both -Wl,-z,defs
>> -Wl,-O1 -m6 1.31s user 0.36s system 99% cpu 1.669 total
>> --- gold ---
>> /usr/bin/g++ -fuse-ld=$linker -Wl,--hash-style=both -Wl,-z,defs
>> -Wl,-O1 -m6 0.42s user 0.11s system 99% cpu 0.537 total
>> --- lld ---
>> /usr/bin/g++ -fuse-ld=$linker -Wl,--hash-style=both -Wl,-z,defs
>> -Wl,-O1 -m6 0.25s user 0.20s system 145% cpu 0.310 total
> Do the constituent object files have debugging information? Sub-second
> processing times for ~350 MiB of output are rather impressive.
Ah! That must be it. I just tried with --with-native-debug-symbols=none
and then I get comparable link times.
/Erik
> On a Sandybridge-era Xeon (probably without SSD storage), I see a change
> from 13 seconds to 8 seconds (BFD to gold). This is the first libjvm.so
> link from “make images”, and the output includes (apparently full)
> debugging information.
>
> Thanks,
> Florian
More information about the build-dev
mailing list