Bug#596970: clang: can't link after compiling with -O4

Anders Kaseorg andersk at MIT.EDU
Tue Jun 21 05:15:14 UTC 2011


To link the output of ‘clang -O4’, you need to have binutils-gold and the 
LLVM gold plugin (LLVMgold.so) installed, and link with ‘clang 
-use-gold-plugin’.  The Debian package currently doesn’t build or install 
the gold plugin.  But that should easy to fix:

1. Adding binutils-dev (>= 2.20.51.20100222-1~) to BUILDDEPS and 
   --with-binutils-include=/usr/include to llvm_confargs causes 
   LLVMgold.so to be built and installed at 
   /usr/lib/llvm-2.9/lib/LLVMgold.so.
2. clang only looks for the plugin at /usr/lib/LLVMgold.so, while ar and 
   nm only look for the plugin at /usr/lib/bfd-plugins/LLVMgold.so, so the 
   plugin needs to be installed or symlinked to both of those two 
   locations.
3. Since LLVMgold.so depends on libLTO.so and Debian strips rpaths from 
   .so files, libLTO.so needs to be available at /usr/lib/libLTO.so (or 
   somewhere else in the dynamic linker search path).

Anders





More information about the Pkg-llvm-team mailing list