gnustep-dev
[Top][All Lists]
Advanced

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

Re: Runtime / exceptions model configuration options


From: Richard Frith-Macdonald
Subject: Re: Runtime / exceptions model configuration options
Date: Wed, 6 Jun 2018 14:10:59 +0100


> On 6 Jun 2018, at 13:55, Riccardo Mottola <address@hidden> wrote:
> 
> Hi All,
> 
> I am a bit confused about how to configure different exceptions and runtimes 
> in gnustep make and gui!
> 
> I notice we have no clear section in a README or INSTALL file or on the wiki, 
> or, in case, I missed it.
> 
> I need to control of it to correctly test libobjc2 by David and also to avoid 
> this error:
> 
> "There are two separate       exception handling mechanisms available ... one 
> based on the standard setjmp() function (which does not require special 
> compiler support), and one 'native' version where the compiler manages the 
> exception handling. If you try to use both in the same executable, exception 
> handlers will not work... which can be pretty disastrous. This error is 
> telling you that the gnustep-base library was built using one form of 
> exception handling, but that the gnustep-make package you are using is 
> building code to use the other form of exception handling ... with the 
> consequence that exception handling would be broken in the program you are 
> building. So, somehow your gnustep-base and gnustep-make package are 
> incompatible, and you need to replace one of them with a version configured 
> to match the other."
> 
> So we have standard and native.
> 
> I understand that standard is default for gcc. Fine.
> 
> The issue is when wanting to use libobjc2 and/or clang.
> 
> gnustep-make if used with clang enables native exceptions (most probably 
> becausde it is clang's default)
> 
> I think that if I use --with-library-combo=ng-gnu-gnu on gnustep-base I 
> enable automatically also native exceptions
> 
> How can I build e.g. with clang and standard exceptions? do I need to pass 
> specific CFLAGS perhaps or do we have ebtter options? I didn't find any.
> 
> For example, would like to compile code with clang but standard exceptions, 
> so that I can rule out gcc issues with libobjc2.

Generally you can use 'configure --help' to find out this sort of thing.
In this case, it tells me

--disable-native-objc-exceptions
   Disable native Objective-C exception support (@try / @catch /
   @finally / @synchronized).  If unspecified, Objective-C exception
   support is enabled if the compiler can compile Objective-C code
   containing @try / @catch / @finally / @synchronized.  Please note
   that native exceptions also require support in the Objective-C
   runtime; GNUstep-base will check for that support and may still
   disable native exceptions if such support is not available.
   Use this option if you do not want to use the native Objective-C
   exception support provided by newer compilers.

So the default is for gnustep-make to use native exceptions, but you can 
override it using --disable-native-objc-exceptions, and you may need to be 
aware that, if the compiler/runtime gnustep-base sees at configure time does 
not support native exceptions, then the base configure process may override the 
setting from when you configured make.  I don't think there should ever be a 
problem if you configure gnustep-make to use traditional setjmp based 
exceptions though.

NB. make sure you have a clean instuall when changing this stuff ... if you 
have some libraries/code built one way and some libraries/code built the other 
way then you will get problems.




reply via email to

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