[lld] r296278 - Add a section about how to use ld.lld.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 25 16:20:42 PST 2017


Author: ruiu
Date: Sat Feb 25 18:20:42 2017
New Revision: 296278

URL: http://llvm.org/viewvc/llvm-project?rev=296278&view=rev
Log:
Add a section about how to use ld.lld.

Modified:
    lld/trunk/docs/index.rst

Modified: lld/trunk/docs/index.rst
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/docs/index.rst?rev=296278&r1=296277&r2=296278&view=diff
==============================================================================
--- lld/trunk/docs/index.rst (original)
+++ lld/trunk/docs/index.rst Sat Feb 25 18:20:42 2017
@@ -109,6 +109,29 @@ build that tree. You need `cmake` and of
   $ cmake -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS=lld -DCMAKE_INSTALL_PREFIX=/usr/local ../llvm-project/llvm
   $ make install
 
+Using LLD
+---------
+
+LLD is installed as ``ld.lld``. On Unix, linkers are invoked by
+compiler drivers, so you are not expected to use that command
+directly. There are a few ways to tell compiler drivers to use ld.lld
+instead of the default linker.
+
+The easiest way to do that is to overwrite the default linker. After
+installing LLD to somewhere on your disk, you can create a symbolic
+link by doing ``ld -s /path/to/ld.lld /usr/bin/ld`` so that
+``/usr/bin/ld`` is resolved to LLD.
+
+If you don't want to change the system setting, you can use clang's
+``-fuse-ld`` option. In this way, you want to set ``-fuse-ld=lld`` to
+LDFLAGS when building your programs.
+
+LLD leaves its name and version number to a ``.comment`` section in an
+output. If you are in doubt whether you are successfully using LLD or
+not, run ``objdump -s -j .comment <output-file>`` and examine the
+output. If the string "Linker: LLD" is included in the output, you are
+using LLD.
+
 History
 -------
 




More information about the llvm-commits mailing list