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: Mon, 20 Nov 2017 19:15:03 +0000

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*)'

Full linker error below.

Linker error when trying to add a .mm version of CXXException to the tests:

(ALSI8)dlobron@bos-lps80:~/build/clangport/akamai/libobjc2/libobjc2-1.8.1/build/Test$ /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 
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*)'
CMakeFiles/CXXException.dir/CXXException.mm.o: In function `_i_Test__retain':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0xc8): undefined reference to `objc_retain(objc_object*)'
CMakeFiles/CXXException.dir/CXXException.mm.o: In function `_i_Test__release':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0xf8): undefined reference to `objc_release(objc_object*)'
CMakeFiles/CXXException.dir/CXXException.mm.o: In function `_c_NSAutoreleasePool__addObject_':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0x149): undefined reference to `objc_autorelease(objc_object*)'
CMakeFiles/CXXException.dir/CXXException.mm.o: In function `finally()':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0x18d): undefined reference to `throw_int()'
CMakeFiles/CXXException.dir/CXXException.mm.o: In function `main':
/home/dlobron/build/clangport/akamai/libobjc2/libobjc2-1.8.1/Test/CXXException.mm:(.text+0x3a2): undefined reference to `catchall()'


reply via email to

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