[LLVMdev] getting gold plugin to work?

Rafael Espindola espindola at google.com
Mon Oct 5 07:21:31 PDT 2009


2009/10/4 Sandeep Patel <deeppatel1987 at gmail.com>:
> Attached is the start of a patch to make the gold plugin work on
> Darwin for use as a cross-compiler.

Nice. I checked that it still builds correctly on linux. I think it is
fine, but Nick should probably have a look.

> There needs to be a build step
> somewhere in llvm-gcc that copies it into libexec/<gcc
> poop>/libLLVMgold.so, but I've been doing that manually for now.

Yes, this is bad. The problem is that we build the plugin in llvm, not
llvm-gcc. Another option is to add a new search directory to llvm-gcc.
That way you could configure llvm-gcc with a --gold-plugin-dir=<path>
and the resulting binary would search there. This would work nicely
when using an already installed llvm copy.

> It doesn't seem that simple use of -O4 results in the plugin learning
> what subtarget is desired. I presume that the llvm-gcc driver needs to
> pass -mcpu down through collect2 into ld somehow. Has anybody solved
> this already? Perhaps we should finally just put the feature string
> into the bitcode?

Interesting. It is probably better to pass it via the command line. I
will try to take a look at it. Do you have a small testcase?

> deep
>

Thanks,
-- 
Rafael Ávila de Espíndola




More information about the llvm-dev mailing list