Re: Linking with lld instead of ld/gold
On Sun, Aug 13, 2017 at 5:08 PM, Sylvestre Ledru wrote: > 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. > The clang installed by ./mach bootstrap in .mozbuild is 3.9.0. Is there any plan to update that to >= 4.0? Thanks. Ben ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Linking with lld instead of ld/gold
On Mon, Aug 14, 2017 at 12:08 AM, Sylvestre Ledru wrote: > Packages for lld on Debian & Ubuntu are available on https://apt.llvm.org/ Ubuntu 16.04 and later also has an lld-4.0 package in its own repos (sudo apt install lld-4.0). ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Linking with lld instead of ld/gold
I believe all three linkers (bfd, gold and lld) can currently do LTO on LLVM bitcode. Naively I'd assume getting cross-compilation-unit optimization combining rust and clang compile units is more of a build system issue than a linker one. -Jeff On Mon, Aug 14, 2017 at 2:16 AM, Henri Sivonen wrote: > On Mon, Aug 14, 2017 at 12:08 AM, Sylvestre Ledru > wrote: >> 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. > > Great news. Thank you! > > Does this enable lld to ingest object files that contain LLVM bitcode > instead of target machine code and to perform cross-compilation-unit > optimization? How far are we from cross-compilation-unit optimization > when some compilation units come from clang and some from rustc? > > -- > Henri Sivonen > hsivo...@hsivonen.fi > https://hsivonen.fi/ > ___ > dev-platform mailing list > dev-platform@lists.mozilla.org > https://lists.mozilla.org/listinfo/dev-platform ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Re: Linking with lld instead of ld/gold
On Mon, Aug 14, 2017 at 12:08 AM, Sylvestre Ledru wrote: > 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. Great news. Thank you! Does this enable lld to ingest object files that contain LLVM bitcode instead of target machine code and to perform cross-compilation-unit optimization? How far are we from cross-compilation-unit optimization when some compilation units come from clang and some from rustc? -- Henri Sivonen hsivo...@hsivonen.fi https://hsivonen.fi/ ___ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform
Linking with lld instead of ld/gold
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