GResource-generated symbols get exported if GLib has glib!1468 fixed
Steps to reproduce:
- Build GTK 3.24.20, using Autotools, against GLib 2.64.4 or older
- Rebuild it with a GLib that has glib!1468 (merged) or its backport glib!1519 (merged)
Expected result: The same symbols are exported in both builds.
Actual result: GResource-generated symbols get exported, in the second build only. This is a diff between lists of exported symbols:
--- debian/libgtk-3-0.symbols (libgtk-3-0_3.24.20-1_amd64)
+++ dpkg-gensymbolseXFnOd 2020-07-09 00:50:15.027590197 +0000
@@ -1,5 +1,8 @@
libgdk-3.so.0 libgtk-3-0 #MINVER#
* Build-Depends-Package: libgtk-3-dev
+ _gdk_get_resource@Base 3.24.20-1
+ _gdk_register_resource@Base 3.24.20-1
+ _gdk_unregister_resource@Base 3.24.20-1
gdk__private__@Base 3.16.2
gdk_add_option_entries_libgtk_only@Base 3.0.0
gdk_anchor_hints_get_type@Base 3.21.5
@@ -758,6 +761,9 @@
gdk_x11_xatom_to_atom@Base 3.0.0
gdk_x11_xatom_to_atom_for_display@Base 3.0.0
libgtk-3.so.0 libgtk-3-0 #MINVER#
+ _gtk_get_resource@Base 3.24.20-1
+ _gtk_register_resource@Base 3.24.20-1
+ _gtk_unregister_resource@Base 3.24.20-1
gtk_about_dialog_add_credit_section@Base 3.3.16
gtk_about_dialog_get_artists@Base 3.0.0
gtk_about_dialog_get_authors@Base 3.0.0
This appears to be because GTK builds with -fvisibility=hidden
, and runs glib-compile-resources
without --internal
.
Before glib!1468 (merged), glib-compile-resources
without --internal
would emit symbols with no particular decoration except for extern
, leaving it up to the library's wider build system whether those symbols are visible or not.
Since glib!1468 (merged), glib-compile-resources
without --internal
emits symbols that are explicitly exported, overriding -fvisibility=hidden
.
I think the Meson build is probably unaffected, due to external : false
being the default behaviour of gnome.compile_resources
. The best solution is probably to pass --internal
to glib-compile-resources
in the Autotools build, too, making the desired behaviour explicit; I'll send a merge request when I have tested that.
I'm not sure whether this would also be considered to be a regression in GLib, or not. What do GLib maintainers think?