<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>Le 21 janv. 2010 à 22:06, Jim Crafton a écrit :</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>David,<br><br><blockquote type="cite"><blockquote type="cite">Thanks! do I use "-fnext-runtime" when I compile with clang or when I use lli?<br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">It needs to be when you run clang.  You almost certainly won't be able to use the resulting code with lli though.  lli interprets the bitcode.  The NeXT runtime uses special segment types to register Objective-C structures.  The segment types and the loader callbacks do not exist in interpreted or JIT-compiled code, so the runtime does not have any way of getting at them.  The interaction between the loader and the NeXT runtime is quite complex.  In contrast, the GNU runtime just expects __objc_exec_class() to be called once per compilation unit, which is done via the same mechanism C++ uses for static initalisers and gcc uses for __attribute__((constructor)) functions in C.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">If you want to JIT compile or interpret Objective-C code for the NeXT runtime then you will need to make calls to objc_allocateClassPair() and so on in your own code.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Is there a sensible reason why you chose to use the NeXT runtime, by the way?<br></blockquote><br>Actually all I really want, ideally, is to be able to use clang/llvm<br>to generate an exe or dll based on ObjectiveC. I'd rather not use the<br>GNU runtime, especially since the Apple one is publicly available, and<br>I'm guessing it's better than the GNU one, plus as a general rule I<br>try to avoid any of the GNU stuff for windows related programming. I<br>don't care about using Cocoa per se, I'd be perfectly happy with just<br>the basic Objective C runtime.<br><font class="Apple-style-span" color="#000000"><font class="Apple-style-span" color="#144FAE"><br></font></font></div></blockquote><br></div><div><br></div><div>The current Apple's objc runtime is maybe better than the old GNU one, but I don't think it will give you more than the GNU objc2 runtime but troubles.</div><div><br></div><div>Trying to use the Apple runtime outside of the Apple world is not recommended and not supported at all. The ObjC runtime is Open source but it heavily relies on Foundation to set it up.</div><div><br></div><div>Without the Apple's Foundation, critical part of the runtime will not work properly.</div><div><br></div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div>-- Jean-Daniel</div><div><br></div><div><br></div></span><br class="Apple-interchange-newline">
</div>
<br></body></html>