GNOME Bugzilla – Bug 794274
gnome-keyring has undefined references
Last modified: 2018-03-13 08:31:29 UTC
gnome-keyring 3.28.0 fails to build from source on Debian with -Wl,-z,defs This is a regression from 3.27.4 Build log excerpt ================= /bin/bash ./libtool --tag=CC --mode=link gcc -Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -g -O2 -fdebug-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat -Werror=format-security -g -Wno-strict-aliasing -Wno-sign-compare -module -avoid-version -no-undefined -export-symbols-regex 'C_GetFunctionList|g_module_check_init' -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -o gkm-xdg-store-standalone.la -rpath /usr/lib/x86_64-linux-gnu/gnome-keyring/devel pkcs11/xdg-store/gkm-xdg-standalone.lo libgkm-xdg-store.la libgkm.la -lgobject-2.0 -lglib-2.0 -lglib-2.0 -lgmodule-2.0 -pthread -lglib-2.0 -lgcrypt libtool: link: /usr/bin/nm -B pkcs11/xdg-store/.libs/gkm-xdg-standalone.o ./.libs/libgkm-xdg-store.a ./.libs/libgkm.a | sed -n -e 's/^.*[ ]\([ABCDGIRSTW][ABCDGIRSTW]*\)[ ][ ]*\([_A-Za-z][_A-Za-z0-9]*\)$/\1 \2 \2/p' | sed '/ __gnu_lto/d' | /bin/sed 's/.* //' | sort | uniq > .libs/gkm-xdg-store-standalone.exp libtool: link: /bin/grep -E -e "C_GetFunctionList|g_module_check_init" ".libs/gkm-xdg-store-standalone.exp" > ".libs/gkm-xdg-store-standalone.expT" libtool: link: mv -f ".libs/gkm-xdg-store-standalone.expT" ".libs/gkm-xdg-store-standalone.exp" libtool: link: echo "{ global:" > .libs/gkm-xdg-store-standalone.ver libtool: link: cat .libs/gkm-xdg-store-standalone.exp | sed -e "s/\(.*\)/\1;/" >> .libs/gkm-xdg-store-standalone.ver libtool: link: echo "local: *; };" >> .libs/gkm-xdg-store-standalone.ver libtool: link: gcc -shared -fPIC -DPIC pkcs11/xdg-store/.libs/gkm-xdg-standalone.o -Wl,--whole-archive ./.libs/libgkm-xdg-store.a ./.libs/libgkm.a -Wl,--no-whole-archive -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lgcrypt -g -O2 -fstack-protector-strong -g -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,-z -Wl,defs -Wl,--as-needed -pthread -pthread -Wl,-soname -Wl,gkm-xdg-store-standalone.so -Wl,-version-script -Wl,.libs/gkm-xdg-store-standalone.ver -o .libs/gkm-xdg-store-standalone.so ./.libs/libgkm.a(libegg_la-mock-interaction.o): In function `mock_interaction_class_init': ./egg/mock-interaction.c:80: undefined reference to `g_tls_interaction_get_type' ./.libs/libgkm.a(libegg_la-mock-interaction.o): In function `mock_interaction_get_type': ./egg/mock-interaction.c:42: undefined reference to `g_tls_interaction_get_type' ./.libs/libgkm.a(libegg_la-mock-interaction.o): In function `mock_interaction_ask_password': ./egg/mock-interaction.c:69: undefined reference to `g_tls_password_set_value' ./.libs/libgkm.a(libegg_la-mock-interaction.o): In function `mock_interaction_new': ./egg/mock-interaction.c:95: undefined reference to `g_tls_interaction_get_type' collect2: error: ld returned 1 exit status
Created attachment 369603 [details] [review] build: Fix linking of test modules with "-z defs" Split out mock-interaction.c from libegg.la to libegg-test.la.
Thank you for the report; indeed, -lgio-2.0 is missing from the linker command line. Since mock-interaction.c is only used by test programs in daemon/ssh-agent, I removed it from libegg.la.
Attachment 369603 [details] pushed as f144112 - build: Fix linking of test modules with "-z defs"
Thanks. The new release fixes my issue.