[cfe-dev] objc_exec_class on Mac OS X

Brendan Younger brendan at brendanyounger.com
Sun Nov 9 20:20:13 PST 2008


Thanks, apparently I wasn't building clang at the same time as LLVM.   
Fixed it by adding clang to the tools/Makefile

Brendan

On Nov 9, 2008, at 8:22 PM, Daniel Dunbar wrote:

> Are you sure the clang you are using is from svn? If that option is
> present you must be working with a much older clang.
>
> Make sure that you are actually running the version you expect (i.e.
> that 'which clang' shows the appropriate build of clang, if you are
> building a debug build this should be something like
> '.../llvm/Debug/bin/clang'.
>
> - Daniel
>
> On Sun, Nov 9, 2008 at 4:15 PM, Brendan Younger
> <brendan at brendanyounger.com> wrote:
>> "llvm-config --host-triple" gives:
>> i686-apple-darwin9.5.0
>> and "clang -emit-llvm-bc -fnext-runtime hello.m" gives
>> clang: Unknown command line argument '-fnext-runtime'.  Try: 'clang  
>> --help'
>> This is all from the current svn.
>> Brendan Younger
>> On Nov 9, 2008, at 6:32 PM, Daniel Dunbar wrote:
>>
>> 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
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>>
>>




More information about the cfe-dev mailing list