discuss-gnustep
[Top][All Lists]
Advanced

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

Re: Crash occurs when catching std::exception in Objective-C++ code comp


From: Richard Frith-Macdonald
Subject: Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2
Date: Thu, 30 Nov 2017 20:48:50 +0000


> On 30 Nov 2017, at 20:23, Lobron, David <address@hidden> wrote:
> 
> 
>>>> The -fgnu-runtime is for using the runtime that comes with the GNU 
>>>> compiler (gcc).
>>> 
>>> More specifically, it is for telling GCC to use the runtime that comes with 
>>> GCC.  If you wish to use the GCC runtime with clang, the correct flag is 
>>> -fobjc-runtime=gcc (optionally with a version, though clang currently 
>>> ignores the version because it doesn’t know of any changes to the GCC 
>>> runtime ABI since clang shipped - I don’t think there are any). 
>> 
>> That's interesting ...I don't think gnustep-make really knows about/supports 
>> the option of using clang with the gcc runtime.
>> If you use gnu-gnu-gnu as the library combo, it's expecting gcc and the gnu 
>> runtime
>> If you use ng-gnu-gnu as the library combo, it's expecting clang and the 
>> gnustep/objc2 runtime
>> If someone is really determined they can override compiler/flags, but I 
>> don't trust my ability to get wierd combination right, so I never try that.
>> Perhaps gnustep-make should try to detect those sorts of override and 
>> protect us from our own mistakes, but there's a limit to how far that can be 
>> taken and we should probably just trust that if people override cimpiler and 
>> flags specifications they know what they are doing.
> 
> Many thanks for your help, guys.
> 
> I updated gnustep-make to set the library combo to ng-gnu-gnu.  This is 
> picked up by the configure script in gnustep-base:
> 
> checking the Objective-C runtime... Next Gen
> 
> However, the next few lines in the configure output of gnustep-base are 
> suspicious:
> 
> checking for custom shared objc library... NONE
> checking objc/runtime.h usability... yes
> checking objc/runtime.h presence... no
> configure: WARNING: objc/runtime.h: accepted by the compiler, rejected by the 
> preprocessor!
> configure: WARNING: objc/runtime.h: proceeding with the compiler's result
> 
> The configure tool fails a few lines later, stating that it can't use clang 
> to compile an ObjC program:
> 
> checking whether objc really works... no
> I don't seem to be able to use your Objective-C compiler to produce
> working binaries!  Please check your Objective-C compiler installation.
> 
> My clang compiler has not changed, so I know the compiler is in fact able to 
> compile ObjC.
> 
> Are there additional flags needed for clang to work with gnustep-base when 
> gnustep-make is using ng-gnu-gnu as the library combo?  My current configure 
> flags for gnustep-base are:
> 
> ./configure 
> CC=/home/dlobron/build/clangport/akamai/llvm/llvm-5.0.0.install/bin/clang 
> CXX=/home/dlobron/build/clangport/akamai/llvm/llvm-5.0.0.install/bin/clang 
> CFLAGS="-m64 -march=opteron -mno-3dnow -ggdb -O2 -Wall -fPIC -fPIC -I 
> /home/dlobron/build/clangport/akamai/common/include" CXXFLAGS="-m64 
> -march=opteron -mno-3dnow -ggdb -O2 -fPIC -fPIC -I 
> /home/dlobron/build/clangport/akamai/common/include" LDFLAGS="-m64  -rdynamic 
> -L/home/dlobron/build/clangport/akamai/common/lib" 
> LD_LIBRARY_PATH=/home/dlobron/build/clangport/akamai/common/lib 
> OBJC2RUNTIME=1 HAVE_BLOCKS=1 BASE_NATIVE_OBJC_EXCEPTIONS=1 
> LIBRARY_COMBO=ng-gnu-gnu \
>               --target=x86_64-unknown-linux-gnu \
>               --with-config-file=/usr/local/akamai/GNUstep/GNUstep.conf \
>               
> --with-ffi-include=/home/dlobron/build/clangport/akamai/common/include \
>               
> --with-ffi-library=/home/dlobron/build/clangport/akamai/common/lib \
>               --enable-icu \
>               --disable-tls \
>               --disable-xml \
>               --disable-zeroconf \
>               --with-gmp-include

:-(
.
You should not need any compiler related configure flags for gnustep-base 
(since it should get those from gnustep-make), just any enable/disable options 
you want and apparently also the ones to say your ffi library is in a 
non-standard location.
From the warning messages, it looks like you have two runtimes installed and 
it's seeing the wrong one.
Possibly you have multiple versions of clang and it's using the wrong one?
If you want to send me the gnustep-make and gnustep-base config logs I could 
look and see if I can spot anything.





reply via email to

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