[LLVMdev] libLLVMgold.so: could not load plugin library

Rafael Espindola espindola at google.com
Fri Jun 25 12:37:08 PDT 2010

> So when I copy it to $PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/ and
> $PREFIX/lib/bfd-plugins/, should I rename it to libLLVMgold.so? Any other
> copies I should make?

The copy in that directory can have any name you like. BFD will try
all. Note that
that is the copy that nm and ar will use. The linker (gold) requires you to pass
-plugin to it.

>> Copying it should cause no problems. just make sure libLTO.so is in a
>> place it can find. What happens if you run ldd on LLVMgold.so?
> Here is the result:
> ldd $LLVMPREFIX/lib/LLVMgold.so
>    linux-gate.so.1 =>  (0x006fa000)
>    libLTO.so => $LLVMPREFI/lib/libLTO.so (0x00f24000)
>    libpthread.so.0 => /lib/libpthread.so.0 (0x00570000)
>    libdl.so.2 => /lib/libdl.so.2 (0x00c4c000)
>    libstdc++.so.6 => /s/gcc-4.3.1/i386_rhel5/lib/libstdc++.so.6 (0x001f0000)
>    libm.so.6 => /lib/libm.so.6 (0x00153000)
>    libgcc_s.so.1 => /s/gcc-4.3.1/i386_rhel5/lib/libgcc_s.so.1 (0x00675000)
>    libc.so.6 => /lib/libc.so.6 (0x002db000)
>    /lib/ld-linux.so.2 (0x00f07000)

Looks like it found libLTO. Another case I have seen is when the
plugin is linked with a different libstdc++ than gold. Is that the
case? You do have libstdc++ in an unusual location...

Rafael Ávila de Espíndola

More information about the llvm-dev mailing list