After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 776876 - gmodule – Various Android bug-fixes
gmodule – Various Android bug-fixes
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2017-01-04 20:07 UTC by Sebastian Dröge (slomo)
Modified: 2017-05-09 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() (1.32 KB, patch)
2017-01-04 20:07 UTC, Sebastian Dröge (slomo)
none Details | Review
gmodule – Check for RTLD_LAZY and others in configure (2.28 KB, patch)
2017-01-04 20:07 UTC, Sebastian Dröge (slomo)
none Details | Review
gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() (1.32 KB, patch)
2017-01-04 20:07 UTC, Sebastian Dröge (slomo)
none Details | Review
gmodule – Check for RTLD_LAZY and others in configure (2.28 KB, patch)
2017-02-08 14:28 UTC, Sebastian Dröge (slomo)
committed Details | Review
gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() on Android 64 bit (2.33 KB, patch)
2017-02-08 14:28 UTC, Sebastian Dröge (slomo)
none Details | Review
gmodule – Don't use RTLD_DEFAULT on Android for g_module_self() on Android 64 bit (2.18 KB, patch)
2017-02-08 14:36 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2017-01-04 20:07:11 UTC
See commit messages for details. Without this, GModule is basically broken on
64 bit Android.
Comment 1 Sebastian Dröge (slomo) 2017-01-04 20:07:16 UTC
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.
Comment 2 Sebastian Dröge (slomo) 2017-01-04 20:07:47 UTC
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.
Comment 3 Sebastian Dröge (slomo) 2017-01-04 20:07:52 UTC
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.
Comment 4 Sebastian Dröge (slomo) 2017-02-08 14:28:31 UTC
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.
Comment 5 Sebastian Dröge (slomo) 2017-02-08 14:28:36 UTC
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.
Comment 6 Sebastian Dröge (slomo) 2017-02-08 14:36:41 UTC
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.
Comment 7 Sebastian Dröge (slomo) 2017-05-09 13:00:57 UTC
Ping? :)
Comment 8 Philip Withnall 2017-05-09 13:28:56 UTC
Review of attachment 345222 [details] [review]:

This looks reasonable to push if you’ve tested it.
Comment 9 Philip Withnall 2017-05-09 13:40:16 UTC
Review of attachment 345229 [details] [review]:

Looks reasonable.
Comment 10 Sebastian Dröge (slomo) 2017-05-09 13:59:07 UTC
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
Comment 11 Sebastian Dröge (slomo) 2017-05-09 14:00:13 UTC
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.