<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>What would be an estimate for the amount of work required to implement this?  Where would I get started if I were to implement it?</div><div><br></div><div>My goal is to run Objective-C programs in the interpreter so I can provide an application-sandbox by disallowing the invocation of certain C-functions and also by disallowing the invocation of certain Objective-C methods.<br><div><br></div><div>Thanks,</div><div><br></div><div>Eric</div><div><br><div><div>On Oct 19, 2009, at 12:01 AM, Chris Lattner wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Oct 18, 2009, at 6:32 PM, Eric Brunstad wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>Is it possible to run Objective-C code in lli?  lli does not seem to want to load Foundation.framework.</div></div></blockquote><div><br></div>It is definitely possible, but we're not there yet.  LLI would have to know about objective-c metadata to register it properly with the runtime.  This is important for things like classes etc.  This isn't conceptually hard, but noone has done it yet.</div><div><br></div><div>-Chris</div><div><br><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Please see below.</div><div><br></div><div>Thanks,</div><div><br></div><div>Eric Brunstad</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(209, 38, 34); "><span style="color: #78482d">#import </span><Foundation/Foundation.h></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #bc24a0">int</span> main(<span style="color: #bc24a0">int</span> argc, <span style="color: #bc24a0">char</span> *argv[])</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">      </span>NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">       </span>NSLog(<span style="color: #d12622">@"test!"</span>);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">      </span>[pool drain];</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-tab-span" style="white-space:pre">     </span><span style="color: #bc24a0">return</span> EXIT_SUCCESS;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">}</div></div><div><br></div><div>cmu-351714:llvm-2.5 ericbrunstad$ /Users/ericbrunstad/Downloads/llvm-2.5/Release/bin/lli -force-interpreter=true -stats  /Users/ericbrunstad/Desktop/test/test.o -load=/System/Library/Frameworks/Foundation.framework/Foundation<br></div><div><br></div><div>Could not resolve external global address: __CFConstantStringClassReference<br>0   lli               0x0000000100687556 (anonymous namespace)::SignalHandler(int) + 470<br>1   libSystem.B.dylib 0x00007fff83ee10aa _sigtramp + 26<br>2   libSystem.B.dylib 0x0000000100a0b4ba _sigtramp + 2092082218<br>3   lli               0x00000001001e8374 llvm::ExecutionEngine::emitGlobals() + 6164<br>4   lli               0x00000001001dbd69 llvm::Interpreter::Interpreter(llvm::ModuleProvider*) + 185<br>5   lli               0x00000001001dbdd8 llvm::Interpreter::create(llvm::ModuleProvider*, std::string*, bool) + 56<br>6   lli               0x0000000100010803 main + 243<br>7   lli               0x00000001000106e8 start + 52<br><br></div></div>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu/">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></blockquote></div><br></div></blockquote></div><br></div></div></body></html>