Where should I put libLLVMgold.so??

Hi,all

I'm using ubuntu8.04 and I'm installing gold-plugin along with the
document of that,

After I built the binutils and LLVM with plugin enabling,and I also
replace ld with ld-new which supports plugin,I tried to compile a hello
world program by this:

llvm-gcc -use-gold-plugin a.a b.o -o hello

which is similar with the example in the document,it tells me that
libLLVMgold.so can not be found ,but I truly put it in the directory
which is the same as the cc1's.

What's the problem with my libLLVMgold.so's position?

Thanks!

Nan

llvm-gcc -use-gold-plugin a.a b.o -o hello

which is similar with the example in the document,it tells me that
libLLVMgold.so can not be found ,but I truly put it in the directory
which is the same as the cc1's.

What's the problem with my libLLVMgold.so's position?

That looks correct. Can you check that
*) It is the correct cc1 :slight_smile: (run llvm-gcc with -v)
*) It works if you call gold directly with it

Thanks!

Nan

Cheers,

Yes,it’s indeedly the correct one,and new ld can also support -plugin option,I don’t know the reason of the trouble,

2009/9/17 Rafael Espindola <espindola@google.com>

Does ld actually work if you pass libLLVMGold.so to it? Try to link
with llvm-gcc without the -use-gold-plugin option and with -v (it will
fail as expected). Copy the collect2 line and add the -plugin line. If
that does work, the only think I can think of is to run llvm-gcc in
gdb and set a breakpoint on the error message.

Cheers,

OMG,that’s just my situation…

I can link with libLLVMgold.so manualy,but will fail in that by llvm-gcc.

Debug llvm-gcc???

Any one installed the gold-plugin successfully can give some instruction?

2009/9/18 Rafael Espindola <espindola@google.com>

Does the directory where you put the gold plugin look like this?
$PREFIX/libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/

Where $PREFIX is the prefix where you installed llvm-gcc

Best regards,
--Edwin

Yes,but ubuntu's directory structure is not exactly the same as the
classic linux distribute,

I put libLLVMgold.so in /usr/lib/gcc/i486-linux-gnu/4.2.4 where cc1 is
also in.

Strange situation,is it a bug for llvm-gcc???

在 2009-09-18五的 12:58 +0300,Török Edwin写道:

Could be. Are you comfortable using gdb? Last time I looked it
was working for me.

Cheers,

Yes,gdb could be a solution,but my final goal is to automalize the linking procedure just like what the GNU build system does,gdb may not works for that.

So,some others mentioned gold-plugin can work for some certain problems,I don’t know how they archieve this.

2009/9/19 Rafael Espindola <espindola@google.com>

Yes,but ubuntu's directory structure is not exactly the same as the
classic linux distribute,

I put libLLVMgold.so in /usr/lib/gcc/i486-linux-gnu/4.2.4 where cc1 is
also in.

Are you sure that is llvm-gcc's cc1, and not your system compiler's?
Try this:
$ llvm-gcc -### -x c /dev/null

Then look for a line containing cc1, something similar to this one:
"/home/edwin/llvm-git/install/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.2.1/cc1"
"-quiet" "-iprefix"
"/home/edwin/llvm-git/install/bin/../lib/gcc/x86_64-unknown-linux-gnu/4.2.1/"
"/dev/null" "-quiet" "-dumpbase" "null" "-mtune=generic" "-auxbase"
"null" "-o" "/tmp/cceoliII.s"

Thank you , yes,I took the wrong directory,and I archieve the goal under
your instructions,

thank you

在 2009-09-19六的 09:51 +0300,Török Edwin写道: