[cfe-dev] FreeBSD kernel - linking

Shantonu Sen ssen at apple.com
Thu Feb 12 10:55:21 PST 2009


That's actually not sufficient. See the Apple bug 6251520 (sorry  
others).

The gist is that -ffreestanding still requires some library functions  
be implemented, for instance to implement structure zeroing on the  
stack. Specifically (and I know this is GCC documentation) <http://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards 
 >:

> GCC requires the freestanding environment provide memcpy, memmove,  
> memset and memcmp

clang may wish to interpret -ffreestanding or -fno-builtin  
differently, but the reality is that gcc (and I think llvm-gcc) still  
require some library calls. clang may want to rely on the same  
assumptions to simplify its implementation.


Shantonu Sen
ssen at apple.com

Sent from my Mac Pro

On Feb 12, 2009, at 10:46 AM, Mike Stump wrote:

> On Feb 12, 2009, at 10:28 AM, Daniel Dunbar wrote:
>> On Thu, Feb 12, 2009 at 7:29 AM, Roman Divacky
>> <rdivacky at freebsd.org> wrote:
>>> 1) clang is forcing many .o to use "memmove" which is not defined
>>> for kernel (kernel does not link with libc). I believe it might
>>> be for static initalization of structure or something
>>>
>>> can this be avoided/altered?
>>
>> Yes. Please file a bug for this issue; I'm not exactly sure how to
>> deal with this.
>
> The canonical ways would be:
>
> -mkernel, -ffreestanding, -fhosted, -fno-builtin-memmove -fno- 
> builtin...
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20090212/95d8f13c/attachment.html>


More information about the cfe-dev mailing list