Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13648 closed Bug Report - Crash (Fixed)

Android 5 fails to load qt libs

Reported by: mspieth Owned by: mspieth
Priority: minor Milestone: 32.0
Component: Ports - Android Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no

Description

Android 5 fails to load qt libraries due to invalid has style

Error message is

E/art     ( 8394): dlopen("/data/app/org.mythtv.mythfrontend-2/lib/arm/libQt5Core_armeabi-v7a.so", RTLD_LAZY) failed: dlopen failed: empty/missing DT_HASH in "libQt5Core_armeabi-v7a.so" (built with --hash-style=gnu?)
--------- beginning of crash
E/AndroidRuntime( 8394): FATAL EXCEPTION: qtMainLoopThread
E/AndroidRuntime( 8394): Process: org.mythtv.mythfrontend, PID: 8394
E/AndroidRuntime( 8394): java.lang.UnsatisfiedLinkError: dlopen failed: empty/missing DT_HASH in "libQt5Core_armeabi-v7a.so" (built with --hash-style=gnu?) 

Attachments (2)

20200713_1538_mythtv_firesticknon4k.patch (937 bytes) - added by Peter Bennett 5 years ago.
Patch for MythTV source to take care of ftello and fseeko
20200713_1538_package_firesticknon4k.patch (870 bytes) - added by Peter Bennett 5 years ago.
Patch for packaging to take care of libexiv2 issue

Download all attachments as: .zip

Change History (10)

comment:1 Changed 5 years ago by mspieth

https://exceptionshub.com/c-android-ndk-unsatisfiedlinkerror-dlopen-failed-empty-missing-dt_hash.html

requires lowering platform to 21 (currently 23) or adding -Wl,--hash-style=both to the linker flags

comment:2 Changed 5 years ago by mspieth

Owner: changed from Mark Spieth to mspieth
Status: newassigned

comment:3 Changed 5 years ago by Peter Bennett

After 61dd131 2020/07/11 Mark Spieth : Android: Set both hash styles for qt build

  1. Setting api to 24 causes this error dlopen failed: cannot locate symbol "register_atfork"
  2. Setting api to 21 causes this compile error in two files fstream:950:9: error: use of undeclared identifier 'fseeko'
  3. Since fseeko and ftello only exist from api 24, I changed those two files to use ftell and fseek instead when compiling for api < 24. Then I got this error: failed: dlopen failed: library "libexiv2.so" not found
  4. Looking at the apk, it contains libexiv2.14.so but not libexiv2.so. I changed mythbuild.sh to include libexiv2.so. Now it contains both. This is not optimal. But it works.

Attached are patch files for the changes. I do not understand why libexiv2.14.so is copied, and why this is ok when running on firestick 4k but not on firestick non-4k.

Changed 5 years ago by Peter Bennett

Patch for MythTV source to take care of ftello and fseeko

Changed 5 years ago by Peter Bennett

Patch for packaging to take care of libexiv2 issue

comment:4 Changed 5 years ago by mspieth

Both patches look fine.

I think the exiv2 lib issue is due to myth tree external version and its getting confused during link. We now have 2 versions I think. Is this statement true? A softlink may be better in that case.

comment:5 Changed 5 years ago by Peter Bennett

Correct - the apk now has 2 copies. I don't know if you can set up a soft link in an apk file. However, libexiv2 and libexiv2.14 are each 1.5 MB so it is very little storage wasted.

comment:6 Changed 5 years ago by David Hampton

IIRC, libexiv2 is used for the myth-31 build and libexiv2 is used for the myth-master build. You don't need them both in the same APK.

comment:7 Changed 5 years ago by Peter Bennett

Resolution: Fixed
Status: assignedclosed

Fixed with b76dbf4214 in mythtv and 1d75297 in packaging.

comment:8 Changed 5 years ago by Stuart Auchterlonie

Milestone: needs_triage32.0
Note: See TracTickets for help on using tickets.