[LLVMdev] Wrong path to libLTO.so in LLVMgold.so on Linux

Markus Trippelsdorf markus at trippelsdorf.de
Wed Nov 16 12:40:55 PST 2011


On 2011.11.16 at 19:43 +0100, Markus Trippelsdorf wrote:
> The path to libLTO.so in LLVMgold.so points to the build
> directory on my machine:
> 
>  % ldd /usr/local/lib/LLVMgold.so
>         linux-vdso.so.1 (0x00007fff3d795000)
>         /var/tmp/build_llvm_clang/Release+Asserts/lib/libLTO.so => not found
>         libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f1703983000)
>         ...
> 
> I have configured clang with: 
> ../llvm/configure --enable-optimized --enable-targets=host --with-binutils-include=/usr/lib/binutils/x86_64-pc-linux-gnu/2.21.53.0.2/include --with-cxx-include-root=/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include/g++-v4 --with-cxx-include-arch=/x86_64-pc-linux-gnu
> 
> Any ideas on how to fix this?

To answer my own question; the following patch fixes the problem for me:

Index: tools/gold/Makefile
===================================================================
--- tools/gold/Makefile	(revision 144800)
+++ tools/gold/Makefile	(working copy)
@@ -24,6 +24,6 @@
 # Because off_t is used in the public API, the largefile parts are required for
 # ABI compatibility.
 CXXFLAGS += -I$(BINUTILS_INCDIR) -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-CXXFLAGS += $(SharedLibDir)/$(SharedPrefix)LTO$(SHLIBEXT)
+CXXFLAGS += -L$(SharedLibDir)/$(SharedPrefix) -lLTO
 
 include $(LEVEL)/Makefile.common

-- 
Markus



More information about the llvm-dev mailing list