llvm.org GIT mirror llvm / 5cb7c56
[docs] As of binutils 2.21.51.0.2, ld.bfd supports plugins too, represent this in docs PR#32760 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306102 91177308-0d34-0410-b5e6-96231b3b80d8 Ekaterina Vaartis 2 years ago
1 changed file(s) with 9 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
66
77 Building with link time optimization requires cooperation from
88 the system linker. LTO support on Linux systems requires that you use the
9 `gold linker`_ which supports LTO via plugins. This is the same mechanism
9 `gold linker`_ or ld.bfd from binutils >= 2.21.51.0.2, as they support LTO via plugins. This is the same mechanism
1010 used by the `GCC LTO`_ project.
1111
1212 The LLVM gold plugin implements the gold plugin interface on top of
2222 How to build it
2323 ===============
2424
25 You need to have gold with plugin support and build the LLVMgold plugin.
26 Check whether you have gold running ``/usr/bin/ld -v``. It will report "GNU
27 gold" or else "GNU ld" if not. If you have gold, check for plugin support
28 by running ``/usr/bin/ld -plugin``. If it complains "missing argument" then
29 you have plugin support. If not, such as an "unknown option" error then you
30 will either need to build gold or install a version with plugin support.
25 Check for plugin support by running ``/usr/bin/ld -plugin``. If it complains
26 "missing argument" then you have plugin support. If not, such as an "unknown option"
27 error then you will either need to build gold or install a recent version
28 of ld.bfd with plugin support and then build gold plugin.
3129
32 * Download, configure and build gold with plugin support:
30 * Download, configure and build ld.bfd with plugin support:
3331
3432 .. code-block:: bash
3533
3634 $ git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils
3735 $ mkdir build
3836 $ cd build
39 $ ../binutils/configure --enable-gold --enable-plugins --disable-werror
40 $ make all-gold
37 $ ../binutils/configure --disable-werror # ld.bfd includes plugin support by default
38 $ make all-ld
4139
42 That should leave you with ``build/gold/ld-new`` which supports
40 That should leave you with ``build/ld/ld-new`` which supports
4341 the ``-plugin`` option. Running ``make`` will additionally build
4442 ``build/binutils/ar`` and ``nm-new`` binaries supporting plugins.
4543