-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
android: don't version shared objects #1907
android: don't version shared objects #1907
Conversation
I believe the reason I made them versioned was because unversioned caused the extremely obvious kinds of problems you might expect, particularly because Bionic doesn't support RPATH in conjunction with issues pertaining to SONAME and NEEDED. If we're lucky I'm wrong in predicting that this will cause terrible breakage primarily on devices we don't own, but if I'm right it should be possible to alternatively fool idiotic Gradle with filenames like libharfbuzz_0.so. (This can be safely changed in SONAME and NEEDED because it's the same length.) |
I imagine as long as the actual in-ELF-header SONAME & SOVER match and this doesn't just change the filename, we should mostly be okay? |
Yes, and we use our own loader anyway. |
738a20e
to
b64fb2c
Compare
Came from koreader/koreader#12348 (comment) Just to point that I've tried it in the past and reverted it in #1272 because koreader/koreader#7040 (comment) I can't state if something above is true or not, but I'm willing to trust my old self. |
Random stupid idea: does it behave any better if you load everything in the global namespace in dl.lua? |
Nope, but I'm not sure it's even correctly supported: ffi.cdef[[
void *dlopen(const char *filename, int flag);
char *dlerror(void);
const static int RTLD_LOCAL = 0;
const static int RTLD_LAZY = 0x00001;
const static int RTLD_NOLOAD = 0x00004;
const static int RTLD_NODELETE = 0x01000;
]]
-- There's a bit of heinous hackery going on on 32-bit ABIs with RTLD_NOW & RTLD_GLOBAL...
-- c.f., https://android.googlesource.com/platform/bionic/+/refs/heads/master/libc/include/dlfcn.h
if ffi.abi("64bit") then
ffi.cdef[[
const static int RTLD_NOW = 0x00002;
const static int RTLD_GLOBAL = 0x00100;
]]
else
ffi.cdef[[
const static int RTLD_NOW = 0x00000;
const static int RTLD_GLOBAL = 0x00002;
]]
end |
It should, that comment was just about bionic mangling the constants depending on the bitness of the arch, but there's another comment later that mentions old API levels not using it implicitly for some things that really really should; and that vaguely rings a bell. |
Or, as the upstream comment says, " |
The android linker ignores `DT_RPATH` / `DT_RUNPATH` entries anyway.
- autotools doesn't by default - ditto with meson - gradle will ignore versioned libraries, and not include them in the APK
b64fb2c
to
bb70127
Compare
This change is