[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 10:34:33 PDT 2009


On Jun 18, 2009, at 12:04 AM, Nicolas Geoffray wrote:

>
> Chris Lattner wrote:
>>
>> The big part of the change was to change .o -> .a.  If nothing
>> references the .o file within the .a, it is quite possible that the
>> code in the .a isn't being linked in...  I'm sorry for the breakage,
>> if you have any idea what the right fix is, I'd really appreciate
>> help :)
>>
>
> 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?

Hi Nicolas,

We don't have makefile machinery to produce relinked .o's anymore, but  
we do have machinery to produce dynamic libraries (.so or .dylib).   
This should work for you.  Alternatively, you can link with the - 
all_load option to the linker, which pulls in all object files in an  
archive.

-Chris



More information about the llvm-commits mailing list