llvm.org GIT mirror llvm / 53843f8
s/libLLVMgold/LLVMgold/g git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110552 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 9 years ago
2 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
7878 the plugin .so file. To find out what link command gcc
7979 would run in a given situation, run gcc -v [...] and look
8080 for the line where it runs collect2. Replace that with
81 ld-new -plugin /path/to/libLLVMgold.so to test it out. Once you're
81 ld-new -plugin /path/to/LLVMgold.so to test it out. Once you're
8282 ready to switch to using gold, backup your existing /usr/bin/ld
8383 then replace it with ld-new.

8484

You can produce bitcode files from llvm-gcc using

9090 linker, which is why you need gold to be the installed system linker in your
9191 path.

9292

If you want ar and nm to work seamlessly as well, install

93 libLLVMgold.so to /usr/lib/bfd-plugins. If you built your
93 LLVMgold.so to /usr/lib/bfd-plugins. If you built your
9494 own gold, be sure to install the ar and nm-new you built to
9595 /usr/bin.
9696

156156 bitcode, everything is in place for an easy to use LTO build of autotooled
157157 projects:

158158
159
  • Follow the instructions on how to build libLLVMgold.so.
  • 159
  • Follow the instructions on how to build LLVMgold.so.
  • 160160
  • Install the newly built binutils to $PREFIX
  • 161
  • Copy Release/lib/libLLVMgold.so to
  • 161
  • Copy Release/lib/LLVMgold.so to
  • 162162 $PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/ and
    163163 $PREFIX/lib/bfd-plugins/
    164164
  • Set environment variables ($PREFIX is where you installed llvm-gcc and
  • 1313
    1414 To build the LLVMgold plugin, configure LLVM with the option
    1515 --with-binutils-include=/path/to/binutils/src/include/ --enable-pic. To use the
    16 plugin, run "ld-new --plugin /path/to/libLLVMgold.so".
    17 Without PIC libLTO and libLLVMgold are not being built (because they would fail
    16 plugin, run "ld-new --plugin /path/to/LLVMgold.so".
    17 Without PIC libLTO and LLVMgold are not being built (because they would fail
    1818 link on x86-64 with a relocation error: PIC and non-PIC can't be combined).
    1919 As an alternative to passing --enable-pic, you can use 'make ENABLE_PIC=1' in
    2020 your entire LLVM build.