llvm.org GIT mirror llvm / bc134cb
Update the LTO GoldPlugin documentation * Update build instructions to reflect the current source tree layout. * Don't inflict CVS on readers; there's a perfectly good git mirror. * configure with --disable-werror making it possible to build using clang. * ar and nm-new now support the -plugin option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196069 91177308-0d34-0410-b5e6-96231b3b80d8 Alp Toker 5 years ago
1 changed file(s) with 11 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
2929 you have plugin support. If not, such as an "unknown option" error then you
3030 will either need to build gold or install a version with plugin support.
32 * To build gold with plugin support:
32 * Download, configure and build gold with plugin support:
3434 .. code-block:: bash
36 $ mkdir binutils
37 $ cd binutils
38 $ cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
39 {enter "anoncvs" as the password}
40 $ cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
36 $ git clone --depth 1 git://sourceware.org/git/binutils-gdb.git binutils
4137 $ mkdir build
4238 $ cd build
43 $ ../src/configure --enable-gold --enable-plugins
39 $ ../binutils/configure --enable-gold --enable-plugins --disable-werror
4440 $ make all-gold
46 That should leave you with ``binutils/build/gold/ld-new`` which supports
47 the ``-plugin`` option. It also built would have
48 ``binutils/build/binutils/ar`` and ``nm-new`` which support plugins but
49 don't have a visible -plugin option, instead relying on the gold plugin
50 being present in ``../lib/bfd-plugins`` relative to where the binaries
51 are placed.
42 That should leave you with ``build/gold/ld-new`` which supports
43 the ``-plugin`` option. Running ``make`` will additionally build
44 ``build/binutils/ar`` and ``nm-new`` binaries supporting plugins.
5346 * Build the LLVMgold plugin: Configure LLVM with
54 ``--with-binutils-include=/path/to/binutils/src/include`` and run
47 ``--with-binutils-include=/path/to/binutils/include`` and run
5548 ``make``.
5750 Usage
7164 ``ld``. It will not look for an alternate linker, which is why you need
7265 gold to be the installed system linker in your path.
74 If you want ``ar`` and ``nm`` to work seamlessly as well, install
75 ``LLVMgold.so`` to ``/usr/lib/bfd-plugins``. If you built your own gold, be
76 sure to install the ``ar`` and ``nm-new`` you built to ``/usr/bin``.
67 ``ar`` and ``nm`` also accept the ``-plugin`` option and it's possible to
68 to install ``LLVMgold.so`` to ``/usr/lib/bfd-plugins`` for a seamless setup.
69 If you built your own gold, be sure to install the ``ar`` and ``nm-new`` you
70 built to ``/usr/bin``.
7973 Example of link time optimization