GNOME Bugzilla – Bug 776876
gmodule – Various Android bug-fixes
Last modified: 2017-05-09 14:00:13 UTC
See commit messages for details. Without this, GModule is basically broken on 64 bit Android.
Created attachment 342891 [details] [review] gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() On 64 bit Android this is #defined to 0, which is considered an invalid library handle in all other cases. RTLD_DEFAULT is only supposed to be used with dlsym() it seems, and the usage here was just an "optimization" before. By dlopen'ing NULL, we get the same on all Android variants and it actually works instead of erroring out.
Created attachment 342892 [details] [review] gmodule – Check for RTLD_LAZY and others in configure They are no #defines on Android but enum values, and on 64 bit Android they have different values than what we would otherwise fall-back to.
Created attachment 342893 [details] [review] gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() On 64 bit Android this is #defined to 0, which is considered an invalid library handle in all other cases. RTLD_DEFAULT is only supposed to be used with dlsym() it seems, and the usage here was just an "optimization" before. By dlopen'ing NULL, we get the same on all Android variants and it actually works instead of erroring out.
Created attachment 345222 [details] [review] gmodule – Check for RTLD_LAZY and others in configure They are no #defines on Android but enum values, and on 64 bit Android they have different values than what we would otherwise fall-back to.
Created attachment 345223 [details] [review] gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() on Android 64 bit On 64 bit Android this is #defined to 0, which is considered an invalid library handle in all other cases. RTLD_DEFAULT is only supposed to be used with dlsym() it seems, and the usage here was just an "optimization" before. By dlopen'ing NULL, we get the same on all 64 bit Android variants and it actually works instead of erroring out. On 32 bit Android, dlopen() of NULL unfortunately usually gives us something useless that finds no symbols whatsoever.
Created attachment 345229 [details] [review] gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() on Android 64 bit On 64 bit Android this is #defined to 0, which is considered an invalid library handle in all other cases. RTLD_DEFAULT is only supposed to be used with dlsym() it seems, and the usage here was just an "optimization" before. By dlopen'ing NULL, we get the same on all 64 bit Android variants and it actually works instead of erroring out. On 32 bit Android, dlopen() of NULL unfortunately usually gives us something useless that finds no symbols whatsoever.
Ping? :)
Review of attachment 345222 [details] [review]: This looks reasonable to push if you’ve tested it.
Review of attachment 345229 [details] [review]: Looks reasonable.
Attachment 345222 [details] pushed as cc5e9f2 - gmodule – Check for RTLD_LAZY and others in configure Attachment 345229 [details] pushed as 0d81bb4 - gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() on Android 64 bit
We're using that in the GStreamer Android binaries since a few releases, should've gotten quite some testing by now from other people than me too.