GNOME Bugzilla – Bug 691756
visbility hidden also need a switch to "default" for gio fam module - g_io_module_load/unload/query
Last modified: 2013-01-15 04:41:55 UTC
`g_io_module_load': /opt/gnome/lib64/gio/modules/libgiofam.so: undefined symbol: g_io_module_load Failed to load module: /opt/gnome/lib64/gio/modules/libgiofam.so Turns up that it is the same issue as: commit 2c13657 on gio/tests/resources though I cannot use _GLIB_EXTERN from config.h as it does as gmacros already defined it (and without the visbility "default" flag) I localy use : __attribute__((visibility("default"))) extern hardcoded to fam-module.c g_io_module_load/unload/query though it is not an option for upstream I guess.
The idea is to include "config.h" before any other headers. gmacros.h will only define _GLIB_EXTERN if nobody else defined it yet (ie: config.h). Does that work for you? Another option is that we could split -fvisibility=hidden out of the CFLAGS and put it in a separate VISIBILITY_CFLAGS or something and include it only in the 5 "main product" libraries we build...
(In reply to comment #1) > Another option is that we could split -fvisibility=hidden out of the CFLAGS and > put it in a separate VISIBILITY_CFLAGS or something and include it only in the > 5 "main product" libraries we build... That's what http://git.gnome.org/browse/glib/commit/?h=wip/symbol-visibility&id=5195ddefba9803bdaa621f9535d48c7e3cb32823 did
Created attachment 233500 [details] [review] visibility: Use a separate CFLAGS variable We only want to control the default visibility for our five main installable libraries: libglib, libgthread, libgmodule, libgobject, libgio. We should therefore only set -fvisibility=hidden when building those. Use a separate substitution variable for this purpose. Using CFLAGS directly leads to some modules built in testcases not exporting their symbols (and then the tests fail). It also affects the fam file monitoring module. Colin had originally done it this way in his visibility patch series but I failed to understand why so I didn't copy it. Now I do. Also: revert changes made to two testcases in an attempt to work around this issue.
Review of attachment 233500 [details] [review]: Looks good to me
Attachment 233500 [details] pushed as 5d42fdd - visibility: Use a separate CFLAGS variable