[LLVMdev] getting gold plugin to work?

Nick Lewycky nicholas at mxc.ca
Thu Oct 8 23:15:39 PDT 2009


Sandeep Patel wrote:
> Attached is the start of a patch to make the gold plugin work on
> Darwin for use as a cross-compiler. 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.

With this patch, it seems that it produces a file named LLVMgold.so 
instead of libLLVMgold.so. Any ideas?

I'll look into it later if you're not sure why, but that's the only 
thing blocking committing it.

> 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?

That's not all. -disable-fp-elim will be dropped, for example. The 
libLTO generated code assumes -mcpu=native, -march=native, frame 
pointers eliminated, etc. This should all be flag controlled but 
nobody's bothered to do it yet.

Nick



More information about the llvm-dev mailing list