Details
-
Bug
-
Resolution: Invalid
-
P2: Important
-
None
-
5.12.0
-
None
-
Host=macOS, target=Android, Qt5.12.0, ndk r18b, Clang, c++_shared
Description
Hi,
I am building an Android application based on Qt5.12.0. For this, I use the ndk r18b in order to use Clang as the compiler and the c++_shared STL.
Everything seems to build correctly for both 32 and 64 bits architectures. However, when I run the application containing the 32 bits binaries I am getting a crash. It happens if I try to catch an exception in lib1, thrown from lib2. Both lib1 and lib2 are static libs built by myself and used to generate a final shared library packaged in the apk next to the Qt pre-built shared libraries (libQt5Core.so, etc..).
This does not happen with the 64 bits libraries.
I run the following command on the pre-built libQt5Core.so for both 32 and 64 bits:
android-ndk-r18b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-readelf -sW libQt5Core.so | grep "Unwind"
output for the 32 bits architecture:
3: 001db439 104 FUNC GLOBAL DEFAULT 12 _Unwind_Resume
6282: 001db435 2 FUNC GLOBAL DEFAULT 12 _Unwind_Complete
6283: 001db509 12 FUNC GLOBAL DEFAULT 12 _Unwind_DeleteException
6284: 001db4a1 52 FUNC GLOBAL DEFAULT 12 _Unwind_GetLanguageSpecificData
6285: 001db4d5 52 FUNC GLOBAL DEFAULT 12 _Unwind_GetRegionStart
6286: 001db27d 160 FUNC GLOBAL DEFAULT 12 _Unwind_RaiseException
6287: 001daf8d 172 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Get
6288: 001dad19 628 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Interpret
6289: 001db0e5 336 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Pop
6290: 001db039 172 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Set
6304: 00000000 0 FUNC GLOBAL DEFAULT UND __gnu_Unwind_Find_exidx
21490: 00000000 0 FILE LOCAL DEFAULT ABS Unwind-EHABI.cpp
21832: 001db31d 280 FUNC LOCAL DEFAULT 12 _ZL13unwind_phase2P13unw_context_tP12unw_cursor_tP21_Unwind_Control_Blockb
21833: 001db23d 48 FUNC LOCAL DEFAULT 12 ZN12_GLOBAL_N_114unwindOneFrameEjP21_Unwind_Control_BlockP15_Unwind_Context
29663: 001db857 8 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE10saveVFPAsXEv
29664: 001db73f 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE11getFloatRegEi
29665: 001db745 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE11setFloatRegEiy
29666: 001db7b3 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE13isSignalFrameEv
29667: 001dbab5 76 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE13stepWithEHABIEv
29668: 001db72f 16 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE13validFloatRegEi
29669: 001db7b9 50 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE15getFunctionNameEPcjPj
29670: 001db851 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE15getRegisterNameEi
29671: 001dbbed 464 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE23getInfoFromEHABISectionEjRKNS_18UnwindInfoSectionsE
29672: 001db7ed 100 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE24setInfoBasedOnIPRegisterEb
29673: 001db74b 84 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE4stepEv
29674: 001db723 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE6getRegEi
29675: 001db7ad 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE6jumptoEv
29676: 001db729 6 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE6setRegEij
29677: 001db79f 14 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE7getInfoEP15unw_proc_info_t
29678: 001db715 14 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEE8validRegEi
29679: 001db713 2 FUNC LOCAL HIDDEN 12 _ZN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEED0Ev
29689: 001dbba9 68 FUNC LOCAL HIDDEN 12 _ZN9libunwind17LocalAddressSpace18findUnwindSectionsEjRNS_18UnwindInfoSectionsE
29690: 001db711 2 FUNC LOCAL HIDDEN 12 _ZN9libunwind20AbstractUnwindCursorD2Ev
29692: 003c3e8c 72 OBJECT LOCAL HIDDEN 17 _ZTVN9libunwind12UnwindCursorINS_17LocalAddressSpaceENS_13Registers_armEEE
29800: 001db439 104 FUNC GLOBAL DEFAULT 12 _Unwind_Resume
36079: 001db435 2 FUNC GLOBAL DEFAULT 12 _Unwind_Complete
36080: 001db509 12 FUNC GLOBAL DEFAULT 12 _Unwind_DeleteException
36081: 001db4a1 52 FUNC GLOBAL DEFAULT 12 _Unwind_GetLanguageSpecificData
36082: 001db4d5 52 FUNC GLOBAL DEFAULT 12 _Unwind_GetRegionStart
36083: 001db27d 160 FUNC GLOBAL DEFAULT 12 _Unwind_RaiseException
36084: 001daf8d 172 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Get
36085: 001dad19 628 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Interpret
36086: 001db0e5 336 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Pop
36087: 001db039 172 FUNC GLOBAL DEFAULT 12 _Unwind_VRS_Set
36101: 00000000 0 FUNC GLOBAL DEFAULT UND __gnu_Unwind_Find_exidx
output for the 64 bits architecture:
8215: 00000000003d1194 60 FUNC LOCAL DEFAULT 9 _Unwind_SetSpColumn
8216: 00000000003d11d0 88 FUNC LOCAL DEFAULT 9 _Unwind_GetGR.localalias.0
8225: 00000000003d267c 192 FUNC LOCAL DEFAULT 9 _Unwind_RaiseException_Phase2
8226: 00000000003d273c 236 FUNC LOCAL DEFAULT 9 _Unwind_ForcedUnwind_Phase2
8227: 00000000003d291c 4 FUNC LOCAL DEFAULT 9 _Unwind_DebugHook
8248: 00000000003d3578 1052 FUNC LOCAL DEFAULT 9 _Unwind_IteratePhdrCallback
8616: 00000000003d11d0 88 FUNC LOCAL DEFAULT 9 _Unwind_GetGR
8656: 00000000003d2c88 248 FUNC LOCAL DEFAULT 9 _Unwind_Resume_or_Rethrow
8992: 00000000003d2920 376 FUNC LOCAL DEFAULT 9 _Unwind_RaiseException
9415: 00000000003d1334 8 FUNC LOCAL DEFAULT 9 _Unwind_GetCFA
9528: 00000000003d2da4 208 FUNC LOCAL DEFAULT 9 _Unwind_Backtrace
9645: 00000000003d13b8 8 FUNC LOCAL DEFAULT 9 _Unwind_GetLanguageSpecificData
9741: 00000000003d2b8c 252 FUNC LOCAL DEFAULT 9 _Unwind_Resume
9986: 00000000003d13c8 40 FUNC LOCAL DEFAULT 9 _Unwind_FindEnclosingFunction
10302: 00000000003d2d80 36 FUNC LOCAL DEFAULT 9 _Unwind_DeleteException
10416: 00000000003d13f8 8 FUNC LOCAL DEFAULT 9 _Unwind_GetTextRelBase
10519: 00000000003d13b0 8 FUNC LOCAL DEFAULT 9 _Unwind_SetIP
11080: 00000000003d2a98 244 FUNC LOCAL DEFAULT 9 _Unwind_ForcedUnwind
11262: 00000000003d13f0 8 FUNC LOCAL DEFAULT 9 _Unwind_GetDataRelBase
11322: 00000000003d13c0 8 FUNC LOCAL DEFAULT 9 _Unwind_GetRegionStart
11394: 00000000003d133c 88 FUNC LOCAL DEFAULT 9 _Unwind_SetGR
11527: 00000000003d4510 452 FUNC LOCAL DEFAULT 9 _Unwind_Find_FDE
11648: 00000000003d139c 20 FUNC LOCAL DEFAULT 9 _Unwind_GetIPInfo
11693: 00000000003d1394 8 FUNC LOCAL DEFAULT 9 _Unwind_GetIP
What I see is that the 32 bits shared library seems to be generated with a mix of gnu STL and llvm STL: 36101: 00000000 0 FUNC GLOBAL DEFAULT UND __gnu_Unwind_Find_exidx
As I understand, the symbol is prefixed by _gnu and seems undefined (UND), so it seems to come from the gnustl_shared STL, while other are defined and are not prefixed with _gnu.
For the 64 bits library, it seems correct and related only to the c++_shared STL.
I know the unwinder used by the NDK toolchain are different for 32 and 64 bit, but is it normal to have those _gnu symbols on a library compiled with Clang ?
Thank you in advance.