s/libLLVMgold/LLVMgold/g
[oota-llvm.git] / tools / gold / README.txt
1 This directory contains a plugin that is designed to work with binutils
2 gold linker. At present time, this is not the default linker in
3 binutils, and the default build of gold does not support plugins.
4
5 Obtaining binutils:
6
7   cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src login
8   {enter "anoncvs" as the password}
9   cvs -z 9 -d :pserver:anoncvs@sourceware.org:/cvs/src co binutils
10
11 This will create a src/ directory. Make a build/ directory and from
12 there configure binutils with "../src/configure --enable-gold --enable-plugins".
13 Then build binutils with "make all-gold".
14
15 To build the LLVMgold plugin, configure LLVM with the option
16 --with-binutils-include=/path/to/binutils/src/include/ --enable-pic. To use the
17 plugin, run "ld-new --plugin /path/to/LLVMgold.so".
18 Without PIC libLTO and LLVMgold are not being built (because they would fail
19 link on x86-64 with a relocation error: PIC and non-PIC can't be combined).
20 As an alternative to passing --enable-pic, you can use 'make ENABLE_PIC=1' in
21 your entire LLVM build.