discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick syntax/compatibility question with libobjc2 and clang 3.4+


From: Tom Bruno
Subject: Re: Quick syntax/compatibility question with libobjc2 and clang 3.4+
Date: Tue, 29 Apr 2014 10:12:03 -0500

David,
  Thank you. PC-BSD, FreeBSD, and OSX were all using the Modern runtime settings and would work on those platforms by default.  Ubuntu's clang i guess does not have this as a default so I couldn't get it to work.  Fixed by building with -fobjc-nonfragile-abi on debian/ubuntu.

Tom


On Apr 29, 2014, at 2:31 AM, David Chisnall <theraven@sucs.org> wrote:

On 29 Apr 2014, at 04:32, Tom Bruno <thomas.bruno@me.com> wrote:

I'm currently using libobjc2 and clang 3.4.  I was researching how NSObject is implemented just learning the ins and outs (I'm very interested in the memory management and such).

One of the things I've noticed is that placing variables in @implementation does not work on linux but seems to work fine on osx like this (Sources at end of email):

#import <objc/runtime.h>

@implementation MAObject {
   Class isa;
   volatile int32_t retainCount;
}


The compiler complains isa and retainCount do not exist.  I've kindof put together that only OSX 64bit mode will work with this code.  Is this a limitation in libobjc2 or clang on linux itself?  Is there something we can do to support this new syntax?

This should work, however you will need to make sure that you are compiling for a modern ABI.  Do your OBJCFLAGS contain either -fobjc-nonfragile-abi, or (ideally) -fobjc-runtime=gnustep-1.7.

David




-- Sent from my Cray X1


reply via email to

[Prev in Thread] Current Thread [Next in Thread]