[llvm-commits] [llvm] r73579 - in /llvm/trunk: Makefile.rules docs/MakefileGuide.html tools/llvmc/driver/Makefile

Chris Lattner clattner at apple.com
Thu Jun 18 11:36:50 PDT 2009


On Jun 18, 2009, at 11:23 AM, Dale Johannesen wrote:

>> So there are lots of functions in vmkit that are not used in vmkit's
>> source code, but that will be used at runtime. With the .o -> .a
>> change,
>> these functions get indeed removed from the final executable, which
>> makes vmkit crash because it can't find the functions. I see two
>> options
>> here:
>>
>> a) Generate a .o again. Have you left in Makefile.rules a way to
>> generate .o instead of .a?
>> b) Hack the source code to force these functions to be linked. I know
>> llvm is doing that a lot in its header files, but I don't know what  
>> is
>> the general rule for doing that. Do you have any advices?
>
> __attribute__((used)) should do it.


__attribute__((used)) won't work with .a files.

-Chris



More information about the llvm-commits mailing list