[LLVMdev] malloc, magic, and embedded compilation

Chris Lattner sabre at nondot.org
Wed May 14 10:20:16 PDT 2008


On Wed, 14 May 2008, Jonathan S. Shapiro wrote:
> On Wed, 2008-05-14 at 16:15 +0200, Duncan Sands wrote:
>> I don't think the logic is based on "main", but on whether functions
>> are marked "internal" or not.  That said, GlobalOpt.cpp seems to reason
>> based on the name "main" (most likely bogus, because of constructors/
>> destructors running before main).
>
> Umm. That sounds like a test case that really wants to get written.

huh?

> Does the LLVM C front-end support the "init" attribute for C functions
> (which has similar effect)?

Yes, we fully support it.  I'm not sure why you think there is a bug here. 
As several people have told you, LLVM is doing the right thing, and if you 
want to build a kernel or something without libc, use -ffree-standing. 
There are serveral existence cases of kernels built with LLVM.

-Chris

-- 
http://nondot.org/sabre/
http://llvm.org/



More information about the llvm-dev mailing list