[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: |
David Chisnall |
Subject: |
Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2 |
Date: |
Mon, 20 Nov 2017 19:21:55 +0000 |
On 20 Nov 2017, at 19:15, Lobron, David <dlobron@akamai.com> wrote:
>
> One more bit of info on the linker error on my .mm test program: I confirmed
> that libobjc.so has the symbols, e.g.,
>
> (ALSI8)dlobron@bos-lps80:~/build/clangport/akamai/common/lib$ nm -C
> libobjc.so|grep objc_autorelease
> 00000000000204b0 T objc_autorelease
> 00000000000200f0 T objc_autoreleasePoolPop
> 000000000001fc90 T objc_autoreleasePoolPush
> 00000000000204f0 T objc_autoreleaseReturnValue
>
> I'm linking with the library:
>
> /home/dlobron/build/clangport/akamai/llvm/llvm-5.0.0.install/bin/clang
> -std=gnu99 -fexceptions -rdynamic
> CMakeFiles/CXXException.dir/CXXException.mm.o -o CXXException
> -Wl,-rpath,/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build
> ../libobjc.so.4.6 -lstdc++ ../libobjcxx.so.4.6
> -L/home/dlobron/build/clangport/akamai/common/lib -lobjcxx -lobjc
>
> But the symbol is still not found:
>
> CMakeFiles/CXXException.dir/CXXException.mm.o: In function
> `_i_Test__autorelease':
> /home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0x98):
> undefined reference to `objc_autorelease(objc_object*)’
This looks like it’s trying to all a version with C++ name mangling. Try
sticking an extern “C” { } around the #includes.
David
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, (continued)
- 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, 2017/11/16
- 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 <=
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/21
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/21
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/21
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/21
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/22
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/22
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Wolfgang Lux, 2017/11/22
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/22
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, Lobron, David, 2017/11/28
- Re: Crash occurs when catching std::exception in Objective-C++ code compiled with clang on Linux and using libobjc2, David Chisnall, 2017/11/29