Thanks to bug https://bugzilla.mozilla.org/show_bug.cgi?id=1336978, it
is now possible to link with LLD (the linker from the LLVM toolchain)
on Linux instead of bfd or gold.

On my laptop (a recent Carbon X1), the performance gain for libxul
linking is quite important:
* 7 seconds for LLD
* 15 seconds for gold
* 34 seconds for bfd.

To use it, you should have a clang >= 4.0 installed and lld installed
on the system.
clang is in charge of the LLD detection with its option -fuse-ld=lld
(this option is also supported by gcc since version 6). Clang will
look for the same version of LLD available on the system.

To use it, just add the following to the .mozconfig file:

export CXX=clang++-5.0
export CC=clang-5.0
ac_add_options --enable-linker=lld

(gcc works too, it has sometime difficulties to find lld. it expects
it to be installed in /usr/bin/ld.lld)

The configure output should show:
checking for linker... lld

Packages for lld on Debian & Ubuntu are available on https://apt.llvm.org/

At the end of the build, the elfhack currently segfaults (see bug
https://bugzilla.mozilla.org/show_bug.cgi?id=1388713 and can be
disabled with ac_add_options --disable-elf-hack) but the rest of the
build is fine (Firefox starts).

I haven't tested performances of the generated binary.

Sylvestre
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to