summaryrefslogtreecommitdiff
path: root/lld/docs
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2017-02-26 00:20:42 +0000
committerRui Ueyama <ruiu@google.com>2017-02-26 00:20:42 +0000
commit9e7d60e7424c21e5026d9d6640eb82370d4c161b (patch)
tree4110b81bfa18e56e94264e659501c13b5aa2f9df /lld/docs
parent909051dcb1a975d5770d22aded83203fd52c094a (diff)
Add a section about how to use ld.lld.
Diffstat (limited to 'lld/docs')
-rw-r--r--lld/docs/index.rst23
1 files changed, 23 insertions, 0 deletions
diff --git a/lld/docs/index.rst b/lld/docs/index.rst
index cc9f90dd0f4..be7ec92cc53 100644
--- a/lld/docs/index.rst
+++ b/lld/docs/index.rst
@@ -109,6 +109,29 @@ build that tree. You need `cmake` and of course a C++ compiler.
$ 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
-------