[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:12:35 +0000 |
> -fgnu-runtime is long-deprecated, and I’m not sure what happens if it’s
> specified *after* -fobjc-runtime=. It may override it (and default to an
> earlier runtime target). It’s probably best to remove it.
>
> Did you run the libobjc2 tests (which include a test for C++ exceptions in
> Objective-C++), and did they pass?
I had been building libobjc2 with tests disabled. I removed the disable flag,
and tried to compile again. I'm finding that the compilation now fails, and
the errors seem a bit telling, because they concern exception personalities.
The errors are very similar:
make[4]: Entering directory
`/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build'
CMakeFiles/CXXExceptions.dir/CXXException.cc.o[ 55%] Building C object
Test/CMakeFiles/BlockImpTest.dir/BlockImpTest.m.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]+0x9):
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'
Scanning dependencies of target CXXExceptions_optimised
clang-6.0: error: linker command failed with exit code 1 (use -v to see
invocation)
And also:
CMakeFiles/CXXExceptions_optimised.dir/CXXException.cc.o: In function
`throw_int':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x7):
undefined reference to `__cxa_allocate_exception'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x12):
undefined reference to `typeinfo for int'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x1c):
undefined reference to `__cxa_throw'
CMakeFiles/CXXExceptions_optimised.dir/CXXException.cc.o: In function
`catchall':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x2c):
undefined reference to `__cxa_begin_catch'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x3b):
undefined reference to `__cxa_rethrow'
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.cc:(.text+0x43):
undefined reference to `__cxa_end_catch'
CMakeFiles/CXXExceptions_optimised.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]+0x2):
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]+0x7):
undefined reference to `std::terminate()'
CMakeFiles/CXXExceptions_optimised.dir/CXXException.cc.o:(.eh_frame+0x3f):
undefined reference to `__gxx_personality_v0'
clang-6.0: error: linker command failed with exit code 1 (use -v to see
invocation)
I enabled messages=yes in my build, but I don't see the compilation commands -
I'm trying now to get those. Do these errors indicate where the problem might
lie?
Thank you again for your help here.
--David
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/01
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/01
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/16
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/16
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2,
Lobron, David <=
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/16
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/17
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/17
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/17
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/17
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/18
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/20
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/20
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/20
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/21