Lines Matching +full:lld +full:- +full:build
1 LLD - The LLVM Linker
4 LLD is a linker from the LLVM project that is a drop-in replacement
8 The linker supports ELF (Unix), PE/COFF (Windows), Mach-O (macOS) and
9 WebAssembly in descending order of completeness. Internally, LLD consists of
16 --------
18 - LLD is a drop-in replacement for the GNU linkers that accepts the
21 - LLD is very fast. When you link a large program on a multicore
22 machine, you can expect that LLD runs more than twice as fast as the GNU
25 - It supports various CPUs/ABIs including AArch64, AMDGPU, ARM, Hexagon,
26 LoongArch, MIPS 32/64 big/little-endian, PowerPC, PowerPC64, RISC-V,
27 SPARC V9, x86-32 and x86-64. Among these, AArch64, ARM (>= v4), LoongArch,
28 PowerPC, PowerPC64, RISC-V, x86-32 and x86-64 have production quality.
31 - It is always a cross-linker, meaning that it always supports all the
33 build-time option to enable/disable each target. This should make it
34 easy to use our linker as part of a cross-compile toolchain.
36 - You can embed LLD in your program to eliminate dependencies on
40 ``lld::lldMain``, from your code.
42 - It is small. We are using LLVM libObject library to read from object
44 2017, LLD/ELF consists only of 21k lines of C++ code while GNU gold
47 - Link-time optimization (LTO) is supported by default. Essentially,
48 all you have to do to do LTO is to pass the ``-flto`` option to clang.
50 but in LLVM bitcode format. LLD reads bitcode object files, compile
51 them using LLVM and emit an output file. Because in this way LLD can
54 - Some very old features for ancient Unix systems (pre-90s or even
57 non-executable by default to tighten security.
60 -----------
62 This is a link time comparison on a 2-socket 20-core 40-thread Xeon
63 E5-2680 2.80 GHz machine with an SSD drive. We ran gold and lld with
64 or without multi-threading support. To disable multi-threading, we
65 added ``-no-threads`` to the command lines.
68 Program Output size GNU ld GNU gold w/o threads GNU gold w/threads lld w/o threads lld w/threads
75 As you can see, lld is significantly faster than GNU linkers.
80 .. [1] Since GNU ld doesn't support the ``-icf=all`` and
81 ``-gdb-index`` options, we removed them from the command line
85 Build
86 -----
88 If you have already checked out LLVM using SVN, you can check out LLD
93 If you haven't checked out LLVM, the easiest way to build LLD is to
94 check out the entire LLVM projects/sub-projects from a git mirror and
95 build that tree. You need `cmake` and of course a C++ compiler.
97 .. code-block:: console
99 $ git clone https://github.com/llvm/llvm-project llvm-project
100 $ mkdir build
101 $ cd build
102 $ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld -DCMAKE_INSTALL_PREFIX=/usr/local ../llvm-project/llvm
105 Using LLD
106 ---------
108 LLD is installed as ``ld.lld``. On Unix, linkers are invoked by
110 directly. There are a few ways to tell compiler drivers to use ld.lld
114 installing LLD to somewhere on your disk, you can create a symbolic
115 link by doing ``ln -s /path/to/ld.lld /usr/bin/ld`` so that
116 ``/usr/bin/ld`` is resolved to LLD.
119 ``-fuse-ld`` option. In this way, you want to set ``-fuse-ld=lld`` to
122 LLD leaves its name and version number to a ``.comment`` section in an
123 output. If you are in doubt whether you are successfully using LLD or
124 not, run ``readelf --string-dump .comment <output-file>`` and examine the
125 output. If the string "Linker: LLD" is included in the output, you are
126 using LLD.
129 ---------
147 ELF/start-stop-gc