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 568406 - gnome-keyring does not like LDFLAGS="-Wl,--no-undefined"
gnome-keyring does not like LDFLAGS="-Wl,--no-undefined"
Status: RESOLVED FIXED
Product: libgnome-keyring
Classification: Core
Component: General
2.25.x
Other All
: Normal normal
: ---
Assigned To: GNOME keyring maintainer(s)
GNOME keyring maintainer(s)
: 570393 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-01-20 10:29 UTC by Funda Wang
Modified: 2019-02-22 11:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.25/2.26


Attachments
Try to make libegg a static library (8.87 KB, patch)
2009-02-07 18:24 UTC, Stef Walter
none Details | Review

Description Funda Wang 2009-01-20 10:29:49 UTC
When building gnome-keyring 2.25.5 with LDFLAGS="-Wl,--no-undefined", it raises errors when linking libgcr.

After applying this patch[1], and disabling specific LDFLAGS, there are still undefined references on libgcr and gck-roots-store-standalone.so:
Warning: undefined symbols in /usr/lib64/libgcr.so.0.0.0: egg_memory_lock egg_memory_fallback egg_memory_unlock
Warning: undefined symbols in /usr/lib64/gnome-keyring/standalone/gck-roots-store-standalone.so: egg_asn1_write_value egg_asn1_read_element egg_asn1_read_time egg_asn1_decode egg_asn1_get_pkix_asn1type egg_symkey_read_cipher egg_asn1_element_length egg_asn1_write_oid egg_asn1_read_dn_part egg_asn1_read_oid egg_openssl_pem_parse egg_asn1_get_pk_asn1type egg_symkey_generate_pkcs12 egg_asn1_read_dn egg_symkey_generate_simple egg_asn1_write_uint egg_asn1_encode egg_asn1_read_value egg_asn1_read_boolean egg_asn1_read_uint egg_asn1_read_content

As libgcr is a system shared library, alll of the references should be solved at linking time. Regarding gck-roots-store-standalone, the undefined references come from internal objects, such as egg/*. Maybe you should split egg/*.la more specificly.
Comment 1 Stef Walter 2009-01-30 22:19:52 UTC
libtool, grumble grumble...

All those symbols are in fact things used by libgcr. And libgcr does link to the egg stuff directly:

libgcr_la_LIBADD = \
	$(top_builddir)/egg/libegg.la \
	$(top_builddir)/egg/libegg-secure-entry.la \
	$(top_builddir)/gp11/libgp11.la \
	$(GOBJECT_LIBS) \
	$(GLIB_LIBS) \
	$(LIBGCRYPT_LIBS) \
	$(LIBTASN1_LIBS)

To be honest I'm really lost when it comes to libtool. I have that flag (ie: --no-undefined) on my machine but it seems to have no effect.

Are you a libtool wizard (or apprentice)? If it'd be awesome if you had a patch that resolved the issue. Otherwise I'll try to muddle my way through this and figure something out. 
Comment 2 Funda Wang 2009-01-31 04:58:04 UTC
may egg_* should be "export"ed?
Comment 3 Stef Walter 2009-02-02 08:18:53 UTC
No, those are internal functions. Only gcr_* functions should be exported.
Comment 4 Funda Wang 2009-02-02 09:49:33 UTC
Then maybe egg should be set as static lib I think.
Comment 5 Stef Walter 2009-02-07 18:20:36 UTC
I get this piece of beauty: 

*** Warning: Linking the shared library libgcr.la against the
*** static library ../egg/libegg.a is not portable!

*** Warning: Linking the shared library libgcr.la against the
*** static library ../egg/libegg-secure-entry.a is not portable!

Along with this:

/usr/bin/ld: ../egg/libegg.a(libegg_a-egg-asn1.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
Comment 6 Stef Walter 2009-02-07 18:24:04 UTC
Created attachment 128177 [details] [review]
Try to make libegg a static library

Here's what I did to try and make libegg a static library.
Comment 7 Stef Walter 2009-02-07 18:32:12 UTC
*** Bug 570393 has been marked as a duplicate of this bug. ***
Comment 8 Stef Walter 2009-02-07 18:44:09 UTC
Tried another approach. Does this fix the problem?

2009-02-07  Stef Walter  <stef@memberwebs.com>

	* gcr/Makefile.am: Add GTK library dependency in libgcr.
	See bug #570393
	
	* pkcs11/gck/Makefile.am:
	* pkcs11/roots-store/Makefile.am:
	* pkcs11/ssh-store/Makefile.am:
	* pkcs11/user-store/Makefile.am: Link libegg into gck where 
	it's actually used. See bug #568406
Comment 9 Christophe Sauthier 2009-02-10 01:12:27 UTC
It seems to solve the issue for me at least ! Thanks stefan ! I have been able to build with the following LDFLAGS := -Wl,-O1 -Wl,-z,defs -Wl,--as-needed
 
Comment 10 Funda Wang 2009-02-10 04:56:50 UTC
It builds correctly. But still has some probs:

Warning: unused libraries in /usr/bin/gnome-keyring:    libgcr.so.0 libpthread.so.0
Warning: undefined symbols in /usr/lib64/libgcr.so.0.0.0: gp11_attributes_add_ulong gp11_attributes_find_ulong gp11_slot_open_session_async gp11_object_get_type gp11_attributes_add_data gp11_attributes_ref gp11_session_create_object_async gp11_session_create_object_full gp11_slot_get_type gp11_session_get_type gp11_slot_open_session_full gp11_attributes_new_full gp11_slot_get_token_info gp11_module_set_auto_authenticate gp11_slot_open_session_finish gp11_attributes_add_boolean gp11_list_unref_free gp11_session_create_object_finish gp11_module_get_slots gp11_module_set_pool_sessions gp11_slot_equal gp11_attributes_new gp11_module_get_type gp11_attributes_get_boxed_type gp11_attributes_unref gp11_attributes_find_string gp11_module_initialize
Comment 11 Stef Walter 2009-02-11 01:00:44 UTC
I'm out of ideas again. libgcr is linked with libgp11 as you can see in gcr/Makefile.am in the libgcr_la_LIBADD section.
Comment 12 Stef Walter 2009-03-05 04:06:38 UTC
I'm assuming this is now fixed. Several other changes have been made to the building of libraries that make up gnome-keyring.