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 691756 - visbility hidden also need a switch to "default" for gio fam module - g_io_module_load/unload/query
visbility hidden also need a switch to "default" for gio fam module - g_io_mo...
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
2.35.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2013-01-15 01:06 UTC by Alban Browaeys
Modified: 2013-01-15 04:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
visibility: Use a separate CFLAGS variable (8.41 KB, patch)
2013-01-15 04:32 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Alban Browaeys 2013-01-15 01:06:58 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.
Comment 1 Allison Karlitskaya (desrt) 2013-01-15 03:39:35 UTC
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...
Comment 2 Colin Walters 2013-01-15 03:43:02 UTC
(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
Comment 3 Allison Karlitskaya (desrt) 2013-01-15 04:32:32 UTC
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.
Comment 4 Matthias Clasen 2013-01-15 04:41:13 UTC
Review of attachment 233500 [details] [review]:

Looks good to me
Comment 5 Allison Karlitskaya (desrt) 2013-01-15 04:41:53 UTC
Attachment 233500 [details] pushed as 5d42fdd - visibility: Use a separate CFLAGS variable