<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>That's actually not sufficient. See the Apple bug 6251520 (sorry others).</div><div><br></div><div>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) <<a href="http://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards">http://gcc.gnu.org/onlinedocs/gcc/Standards.html#Standards</a>>:</div><div><br></div><div><blockquote type="cite"><span class="Apple-style-span" style="font-family: Times; font-size: 16px; ">GCC requires the freestanding environment provide <code>memcpy</code>, <code>memmove</code>, <code>memset</code> and <code>memcmp</code></span></blockquote><div><br></div><div>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.</div><div><br></div></div><br><div>
<div>Shantonu Sen</div><div><a href="mailto:ssen@apple.com">ssen@apple.com</a></div><div><br class="webkit-block-placeholder"></div><div>Sent from my Mac Pro</div>
</div>
<br><div><div>On Feb 12, 2009, at 10:46 AM, Mike Stump wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Feb 12, 2009, at 10:28 AM, Daniel Dunbar wrote:<br><blockquote type="cite">On Thu, Feb 12, 2009 at 7:29 AM, Roman Divacky <br></blockquote><blockquote type="cite"><<a href="mailto:rdivacky@freebsd.org">rdivacky@freebsd.org</a>> wrote:<br></blockquote><blockquote type="cite"><blockquote type="cite">1) clang is forcing many .o to use "memmove" which is not defined<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">for kernel (kernel does not link with libc). I believe it might<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">be for static initalization of structure or something<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">can this be avoided/altered?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Yes. Please file a bug for this issue; I'm not exactly sure how to<br></blockquote><blockquote type="cite">deal with this.<br></blockquote><br>The canonical ways would be:<br><br>-mkernel, -ffreestanding, -fhosted, -fno-builtin-memmove -fno-builtin...<br>_______________________________________________<br>cfe-dev mailing list<br><a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></div></blockquote></div><br></body></html>