[cfe-dev] objc_exec_class on Mac OS X

Daniel Dunbar daniel at zuster.org
Sun Nov 9 15:32:11 PST 2008


Does it work if you use the -fnext-runtime flag?
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?

 - Daniel

On Sun, Nov 9, 2008 at 3:17 PM, Brendan Younger
<brendan at brendanyounger.com>wrote:

> Hi,
>
> I've been trying to get clang to compile Objective-C code on Mac OS X
> for a while now.  I keep getting linker errors of the form
>
> Undefined symbols:
>   "___objc_exec_class", referenced from:
>       _.objc_load_function in cc5ZSPXw.o
>
> and from what I can tell, _objc_exec_class is a GNUStep function which
> is apparently not in Apple's libobjc.  In case anyone wants to try
> this themselves, compiling the following with "clang -emit-llvm-bc -
> x=objective-c < hello.m | llc > hello.s" and then "gcc -o hello -
> framework Foundation -lobjc hello.s" fails with the undefined symbol
> message above.
>
> #import <Foundation/Foundation.h>
>
> int main(int argc, char const *argv[]) {
>        NSLog(@"Hello, world!");
>        // printf("Hello, world!\n");
>
>        return 0;
> }
>
> Any ideas?
>
> Brendan Younger
> _______________________________________________
> 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/20081109/5036eb04/attachment.html>


More information about the cfe-dev mailing list