[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: things that fail to build with gcc and libobjc2
From: |
Richard Frith-Macdonald |
Subject: |
Re: things that fail to build with gcc and libobjc2 |
Date: |
Wed, 6 Apr 2011 12:49:37 +0100 |
On 6 Apr 2011, at 11:53, Sebastian Reitenbach wrote:
> On Wednesday, April 06, 2011 11:22:08 am David Chisnall wrote:
>> On 6 Apr 2011, at 08:46, Sebastian Reitenbach wrote:
>>> Hi,
>>>
>>> I recompiled everything yesterday with gcc 4.2.1 and without libobjc2.
>>> For some of the stuff in the list I sent in the other thread, I have
>>> taken it from svn/cvs since the last releases available releases did not
>>> compiled. Everything compiled with it with the new gnustep core from
>>> svn.
>>>
>>> Now I tried again to build everything with gcc again, but with libobjc2.
>>> The success rate is unfortunately not at 100%.
>>>
>>> SOPE 1.3.4 (1.3.6 will be released probably this week, so still have to
>>> test newer version, but I guess there is not much changed in this file)
>>> fails to
>>
>>> compile this way:
>> These all look like failures due to trying to inspect the runtime data
>> structures directly. This is not supported with libobjc2 (or with the
>> recent Apple runtimes). I they have code paths for Apple's runtime, then
>> they should also work with libobjc2.
> IIRC, helge used to compile it on apple, so I'll probably find some #ifdefs
> in
> there that check for the runtime. Is there an easy way to distinguish between
> the traditional and new libobjc2 runtime? is there a #defined version I could
> check?
I'm not entirely sure what you mean by libobjc2 runtime above. You might be
referring to david's libobjc2 runtime, but from the context you might just mean
the Apple ObjectiveC-2 runtime API (which GNUstep has adopted).
If the former ... I expect you should not be using any libobjc2 specific code
... all that stuff is experimental and ties you to a single runtime, so it
should be avoided unless you specifically want to limit your code to using that
runtime because you want to use one of those experimental features. However,
if you really do want to do that, I think the runtime headers define
__GNUSTEP_RUNTIME__ so that you can use #ifdef with that.
If the latter, then unless you want new versions of the apps to work with old
versions of GNUstep, there's no point having any #ifdef'd runtime code at all
... you should just stick to the modern API since the next release of GNUstep
provides the modern API.
Finally, if you want your source to still build with old versions of GNUstep,
you can test for the presence of the OBJC2RUNTIME macro.
If the macro is undefined ... you have an older version of GNUstep, before we
adopted the modern API.
If it has a value 0 then we provide the modern API on top of an old/stable
runtime (libobjc from gnustep svn or gnu libobjc from an older gcc)
If it has a value 1 then the runtime provides the modern API directly (libobjc2
from gnustep svn or gnu libobjc from the latest gcc)
So, probably you want to either use '#if defined(OBJC2RUNTIME)' or you just
want to remove all ifdefs and use the modern API.
RE: things that fail to build with gcc and libobjc2, Nicola Pero, 2011/04/06
Re: things that fail to build with gcc and libobjc2, Wolfgang Lux, 2011/04/06