Comments (12)
Most of 'em already do that by default, otherwise it's messy, and, for autotools stuff, it involves reverting the libtool hack that we need for I don't even remember what that disabled Android-specific quirks, one of which was that soname trickery, IIRC.
As for CMake stuff, jpeg-turbo is broken (again, don't remember how) when built in Android mode, which also did the same thing to the soname, besides breaking it ;p.
from koreader-base.
Doing it post-build involves modifying the ELF header, which patchelf can probably do, but then patchelf is known to randomly break some binaries, so, eh ^^.
from koreader-base.
from koreader-base.
Uuuuuh, In principle adding -Wl,-soname whatever.so
in ldflags is what the NDK does automatically. I see that we do that for some libs: https://github.com/koreader/koreader-base/search?q=-Wl%2C-soname
As I don't have any idea about autotools (or generally about build tools) I have no idea if this is feasible.
Anyways, the list of libs that need a change in soname are:
from koreader-base.
For many of them you could simply remove my patch, but I put that in there
to work around specific Android issues (among other things it's a simple
hack to avoid clashes with system libs like zlib iirc 'cause bionic kinda
sucks). Cf. #521
Oh, that's interesting. Indeed they can clash with system libraries, but I have no way to check that. Did it happen at some point?
from koreader-base.
from koreader-base.
FWIW, many (if not all) of those are indeed libtool-generated ;).
(Possible special exception for OpenSSL, which uses a truly horrendous custom buildsystem, but it might ultimately use libtool for those anyway).
from koreader-base.
Yes, see some of the linked issues. That libjpeg.so.8 you mentioned is guaranteed to break.
You can of course change the name to androidsuckslibjpeg.so instead.
I will try to revert #521 and see what crashes before changing library names. Also I think part of https://github.com/koreader/android-luajit-launcher/blob/master/assets/dl.lua was meant to address the fact that we're loading libs from filesDir instead of libraryDir, but I never played with the code. Let's see.
from koreader-base.
I will try to revert #521 and see what crashes before changing library names.
On many of our devices (un)fortunately nothing. A few of them will crash on Android <=4.2 or 8+ guaranteed though.
Also I think part of https://github.com/koreader/android-luajit-launcher/blob/master/assets/dl.lua was meant to address the fact that we're loading libs from filesDir instead of libraryDir, but I never played with the code. Let's see.
Have fun fighting with Bionic. Especially on 4.x. ;-)
from koreader-base.
I will try to revert #521 and see what crashes before changing library names.
On many of our devices (un)fortunately nothing. A few of them will crash on Android <=4.2 or 8+ guaranteed though.
Also I think part of https://github.com/koreader/android-luajit-launcher/blob/master/assets/dl.lua was meant to address the fact that we're loading libs from filesDir instead of libraryDir, but I never played with the code. Let's see.
Have fun fighting with Bionic. Especially on 4.x. ;-)
I have good news π
These kind of issues, like:
12-21 21:06:04.314 8277 8300 I KOReader: Android 11 - R (API 30) - flavor: rocks
12-21 21:06:04.366 8277 8300 I KOReader: initializing for device sdk_gphone_x86_64_arm64
12-21 21:06:04.366 8277 8300 I KOReader: framebuffer resolution: {
12-21 21:06:04.366 8277 8300 I KOReader: ["w"] = 1080,
12-21 21:06:04.366 8277 8300 I KOReader: ["h"] = 1920,
12-21 21:06:04.366 8277 8300 I KOReader: }
12-21 21:06:04.369 8277 8300 V dlopen : dl.dlopen - library lname detected /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:06:04.370 8277 8300 V dlopen : dl.dlopen - opening needed libz.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:06:04.370 8277 8300 V dlopen : dl.dlopen - library lname detected /system/lib/libz.so
12-21 21:06:04.371 8277 8300 V dlopen : sys_dlopen - loading library /system/lib/libz.so
12-21 21:06:04.371 8277 8300 V dlopen : dl.dlopen - opening needed libjpeg.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:06:04.371 8277 8300 V dlopen : dl.dlopen - library lname detected /system/lib/libjpeg.so
12-21 21:06:04.372 8277 8300 V dlopen : sys_dlopen - loading library /system/lib/libjpeg.so
12-21 21:06:04.373 8277 8300 E KOReader: [NativeThread]: failed to run script: setupkoenv.lua:27: Not able to load dynamic library: libs/libmupdf.so
12-21 21:06:04.373 8277 8300 E KOReader: [NativeThread]: Stopping due to previous errors
Are reproducible everywhere if we have an unversioned libjpeg.so
in android.filesDir
Are not reproducible when we bundle our own copy of libjpeg.so
in android.nativeLibraryDir πππ
So the flow:
- unversioning
- move them to android.nativeLibraryDir
- do symlinks where they're expected
Produces a very reliable APK, except for rapidjson.so
, which is missing for some unrelated reason :p
from koreader-base.
That's great, even on 4.0? π―
from koreader-base.
I don't have an emulator for 14-15, and the emulator for 21 is broken. But works on the rest of them and actual devices
This is the full thing for mupdf
with all libraries in place
12-21 21:33:38.955 8463 8514 I KOReader: Android 11 - R (API 30) - flavor: rocks
12-21 21:33:39.010 8463 8514 I KOReader: initializing for device sdk_gphone_x86_64_arm64
12-21 21:33:39.010 8463 8514 I KOReader: framebuffer resolution: {
12-21 21:33:39.010 8463 8514 I KOReader: ["h"] = 1920,
12-21 21:33:39.010 8463 8514 I KOReader: ["w"] = 1080,
12-21 21:33:39.010 8463 8514 I KOReader: }
12-21 21:33:39.014 8463 8514 V dlopen : dl.dlopen - library lname detected /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.015 8463 8514 V dlopen : dl.dlopen - opening needed libz.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.015 8463 8514 V dlopen : dl.dlopen - library lname detected /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libz.so
12-21 21:33:39.015 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libz.so
12-21 21:33:39.015 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.016 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
12-21 21:33:39.016 8463 8514 V dlopen : sys_dlopen - loading library /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libz.so
12-21 21:33:39.016 8463 8514 V dlopen : dl.dlopen - opening needed libjpeg.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.017 8463 8514 V dlopen : dl.dlopen - library lname detected /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libjpeg.so
12-21 21:33:39.018 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libjpeg.so
12-21 21:33:39.018 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.019 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
12-21 21:33:39.019 8463 8514 V dlopen : sys_dlopen - loading library /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libjpeg.so
12-21 21:33:39.019 8463 8514 V dlopen : dl.dlopen - opening needed libfreetype.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.019 8463 8514 V dlopen : dl.dlopen - library lname detected /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.020 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.020 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.021 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
12-21 21:33:39.021 8463 8514 V dlopen : sys_dlopen - loading library /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.021 8463 8514 V dlopen : dl.dlopen - opening needed libharfbuzz.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.022 8463 8514 V dlopen : dl.dlopen - library lname detected /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libharfbuzz.so
12-21 21:33:39.022 8463 8514 V dlopen : dl.dlopen - opening needed libm.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libharfbuzz.so
12-21 21:33:39.022 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libm.so
12-21 21:33:39.023 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libm.so
12-21 21:33:39.023 8463 8514 V dlopen : dl.dlopen - opening needed libfreetype.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libharfbuzz.so
12-21 21:33:39.023 8463 8514 V dlopen : dl.dlopen - library lname detected /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.024 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.024 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.024 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
12-21 21:33:39.024 8463 8514 V dlopen : sys_dlopen - loading library /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libfreetype.so
12-21 21:33:39.025 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libharfbuzz.so
12-21 21:33:39.025 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.025 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
12-21 21:33:39.025 8463 8514 V dlopen : sys_dlopen - loading library /data/app/~~FJZspMVmEGU3lQXB9zLVLA==/org.koreader.launcher-Q1j57HciDDhC2ZRPuXmjIg==/lib/x86/libharfbuzz.so
12-21 21:33:39.026 8463 8514 V dlopen : dl.dlopen - opening needed libm.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.026 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libm.so
12-21 21:33:39.026 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libm.so
12-21 21:33:39.027 8463 8514 V dlopen : dl.dlopen - opening needed liblog.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.027 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/liblog.so
12-21 21:33:39.028 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/liblog.so
12-21 21:33:39.028 8463 8514 V dlopen : dl.dlopen - opening needed libc.so for /data/user/0/org.koreader.launcher/files/libs/libmupdf.so
12-21 21:33:39.028 8463 8514 V dlopen : dl.dlopen - library lname detected /system/lib/libc.so
12-21 21:33:39.028 8463 8514 V dlopen : sys_dlopen - loading library /system/lib/libc.so
from koreader-base.
Related Issues (20)
- Dropbear URL broken HOT 2
- SDL: Disables screensaver HOT 8
- czmq: kindle build fails HOT 6
- Add SDL2 library HOT 3
- Is it doable/reasonable to add opencv? HOT 3
- add functions to save images to file. HOT 8
- Pocketbook: Make distinction between NTX and Allwinner boards HOT 12
- sdcv update broke mac CI HOT 12
- Are those two lines necessary? HOT 2
- SDL: do something with SDL_GL_GetDrawableSize
- button-listen doesn't seem to work on reMarkable 1 HOT 3
- Stressful PDF corpus
- Clobbering of slots in MT protocol handling HOT 12
- blitbuffer paintRect and fill alpha values HOT 5
- koreader cannot build without network access (seeking feedback for PR) HOT 20
- lunasvg compile error with gcc-13.1.0 HOT 6
- Gentoo zlib mirror link no longer available HOT 8
- build fails for folder with spaces HOT 2
- curl fails to build with autoconf 2.72 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from koreader-base.