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: Lobron, David
Subject: Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2
Date: Thu, 16 Nov 2017 21:41:19 +0000

I did a verbose build of libobjc2.  The compilation line for CXXException.cc 
looks like this:

[ 48%] Building CXX object Test/CMakeFiles/CXXExceptions.dir/CXXException.cc.o
cd /home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test && 
/usr/bin/clang  -DGC_DEBUG -DGNUSTEP -DNO_LEGACY -DTYPE_DEPENDENT_DISPATCH 
-D_BSD_SOURCE=1 -D_XOPEN_SOURCE=700 -D__BSD_VISIBLE=1 
-D__OBJC_RUNTIME_INTERNAL__=1 
-I/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1  
-fobjc-runtime=gnustep-1.7 -fblocks -O0 -o 
CMakeFiles/CXXExceptions.dir/CXXException.cc.o -c 
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc

I noticed that -fobjc-runtime is set to gnustep-1.7 rather than gnustep-1.8.  
Could that be the problem?

This line also seemed suspicious:

/home/dlobron/build/clangport/akamai/llvm/llvm-5.0.0.install/bin/clang 
-std=gnu99  -fexceptions  -rdynamic 
CMakeFiles/CXXExceptions.dir/CXXException.m.o 
CMakeFiles/CXXExceptions.dir/CXXException.cc.o  -o CXXExceptions 
-Wl,-rpath,/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build 
../libobjc.so.4.6

Could the gnu99 or -fexceptions be the problem? 

I've copied all the lines leading up to the error below.  CXXException.cc seems 
to be the source of the error, which seems very suggestive.

Thank you again for the help here!

--David

make -f Test/CMakeFiles/BlockImpTest.dir/build.make 
Test/CMakeFiles/BlockImpTest.dir/depend
make[4]: Leaving directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
make -f Test/CMakeFiles/Forward_optimised.dir/build.make 
Test/CMakeFiles/Forward_optimised.dir/build
make[4]: Entering directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
cd /home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build && 
/home/dlobron/build/clangport/akamai/common/bin/cmake -E cmake_depends "Unix 
Makefiles" /home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1 
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test 
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build 
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test 
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/BlockImpTest.dir/DependInfo.cmake
 --color=
make[4]: Entering directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
make[4]: Entering directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
Dependee 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/NestedExceptions.dir/DependInfo.cmake"
 is newer than depender 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/NestedExceptions.dir/depend.internal".
Dependee 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/CMakeDirectoryInformation.cmake"
 is newer than depender 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/NestedExceptions.dir/depend.internal".
Scanning dependencies of target NestedExceptions
make[4]: Leaving directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
make -f Test/CMakeFiles/NestedExceptions.dir/build.make 
Test/CMakeFiles/NestedExceptions.dir/build
CMakeFiles/CXXExceptions.dir/CXXException.cc.o: In function `throw_int':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x13):
 undefined reference to `__cxa_allocate_exception'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x1b):
 undefined reference to `typeinfo for int'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x3b):
 undefined reference to `__cxa_throw'
CMakeFiles/CXXExceptions.dir/CXXException.cc.o: In function `catchall':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x65):
 undefined reference to `__cxa_begin_catch'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x78):
 undefined reference to `__cxa_rethrow'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x8b):
 undefined reference to `__cxa_end_catch'
CMakeFiles/CXXExceptions.dir/CXXException.cc.o: In function 
`__clang_call_terminate':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0xDependee
 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/BlockImpTest.dir/DependInfo.cmake"
 is newer than depender 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/BlockImpTest.dir/depend.internal".
Dependee 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/CMakeDirectoryInformation.cmake"
 is newer than depender 
"/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test/CMakeFiles/BlockImpTest.dir/depend.internal".
Scanning dependencies of target BlockImpTest
[ 53%] Building C object Test/CMakeFiles/Forward_optimised.dir/Forward.m.o
make[4]: Entering directory 
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
9): undefined reference to `__cxa_begin_catch'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text.__clang_call_terminate[__clang_call_terminate]+0x12):
 undefined reference to `std::terminate()'
CMakeFiles/CXXExceptions.dir/CXXException.cc.o:(.eh_frame+0x47): undefined 
reference to `__gxx_personality_v0'
clang-6.0: error: linker command failed with exit code 1 (use -v to see 
invocation)


reply via email to

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