<span class="Apple-style-span" style="border-collapse: collapse; ">Does it work if you use the -fnext-runtime flag?<div><br></div><div>On Mac OS X, this should be the default, however it appears that you are getting code for the GNU runtime. I just scanned over the implementation and don't see an obvious problem. What is your target triple?<br>
<br></div><div> - Daniel</div></span><br><div class="gmail_quote">On Sun, Nov 9, 2008 at 3:17 PM, Brendan Younger <span dir="ltr"><<a href="mailto:brendan@brendanyounger.com">brendan@brendanyounger.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
I've been trying to get clang to compile Objective-C code on Mac OS X<br>
for a while now.  I keep getting linker errors of the form<br>
<br>
Undefined symbols:<br>
   "___objc_exec_class", referenced from:<br>
       _.objc_load_function in cc5ZSPXw.o<br>
<br>
and from what I can tell, _objc_exec_class is a GNUStep function which<br>
is apparently not in Apple's libobjc.  In case anyone wants to try<br>
this themselves, compiling the following with "clang -emit-llvm-bc -<br>
x=objective-c < hello.m | llc > hello.s" and then "gcc -o hello -<br>
framework Foundation -lobjc hello.s" fails with the undefined symbol<br>
message above.<br>
<br>
#import <Foundation/Foundation.h><br>
<br>
int main(int argc, char const *argv[]) {<br>
        NSLog(@"Hello, world!");<br>
        // printf("Hello, world!\n");<br>
<br>
        return 0;<br>
}<br>
<br>
Any ideas?<br>
<font color="#888888"><br>
Brendan Younger<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</font></blockquote></div><br>