discuss-gnustep
[Top][All Lists]
Advanced

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

Re: things that fail to build with gcc and libobjc2


From: Sebastian Reitenbach
Subject: Re: things that fail to build with gcc and libobjc2
Date: Wed, 6 Apr 2011 14:28:24 +0200
User-agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-xen; KDE/4.4.4; x86_64; ; )

Hi,
On Wednesday, April 06, 2011 01:49:37 pm Richard Frith-Macdonald wrote:
> 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).
I use the libobjc2 from David on OpenBSD. I meant that Helge compiled and used 
sope with ogo years ago, probably before the new Apple ObjectiveC-2 runtime 
API. 

> 
> 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.
I prefer to have sope, and the other few apps that failed to compile with both 
old gnu and new libobjc2 runtime. Its just that with the new libobjc2 runtime, 
sope and the others do not compile anymore, so I guess its using sth. too old, 
that the new runtime doesn't provide anymore.

> 
> 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.
Since other apps are also working, I should probably try to find sth. that 
works with old gnu and newer gnustep libobjc2 runtime without the need of  
#ifdefs at all.

thanks,
Sebastian



reply via email to

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