[LLVMdev] getting gold plugin to work?

Sandeep Patel deeppatel1987 at gmail.com
Thu Oct 8 23:23:58 PDT 2009


On Fri, Oct 9, 2009 at 6:15 AM, Nick Lewycky <nicholas at mxc.ca> wrote:
> 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?

LOADABLE_MODULE causes that, but it is necessary to get -module passed
to libtool.

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

How does this work in the Darwin linker? Or doesn't it?

deep



More information about the llvm-dev mailing list