1
votes

There are instructions on llvm.org on how to add the Gold plugin to LLVM-gcc; however since version 3.2 they are not using LLVM-gcc anymore, using Clang instead, and it's unclear on how to use it.

  1. Does anyone know how to add the Gold plugin to LLVM 3.2?
  2. Do we need to install this plug-in at all, or is it embedded in Clang?

I've read that if you don't have Gold plugin as linker, if you try -O4 for LTO it will treats it as -O3, but I suppose it is when you use gcc system linker and not when using Clang, right?

1

1 Answers

0
votes

1-If you don't want to change any thing in home/bin directory, then you can compile and install binutils and LLVM in same place it will automatically generate ld,ar and (not ld_new) in llvm/bin directory and since llvm first looks to its own directory to find tools (clang -print-search-dirs) so you can be sure that clang will invoke ld gold in link time first. Its not mentioned in LLVMgold.html but its needed to create bfd-plugins directory in lib and install both LLVMgold.so and linLTO.so there.

2- to support LTO in LLVM we need gold plugin and need to be rebuilt to support it. -O4 is similar to -O3 -flto