GNOME Bugzilla – Bug 692810
[GTK+2] Fails to build with the gold linker due to missing reference to gmodule-2.0
Last modified: 2013-02-10 14:19:19 UTC
Since the GNU gold linker uses '--no-copy-dt-needed-entries'/'--no-add-needed' by default, every reference to symbols coming from indireclty referenced libraries will cause linking to fail: libtool: link: gcc -DGDK_PIXBUF_DISABLE_DEPRECATED -g -O2 -Wall -o .libs/testing testing.o -L/home/em/dev/gnome-world-3.8/build/lib64 ../../gdk/.libs/libgdk-x11-2.0.so ../../gtk/.libs/libgtk-x11-2.0.so -lpangocairo-1.0 -lX11 -lXcomposite -lXdamage -lXfixes -latk-1.0 /usr/lib/x86_64-linux-gnu/libcairo.so -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 /usr/lib/x86_64-linux-gnu/libfreetype.so /home/em/dev/gnome-world-3.8/build/lib64/libfontconfig.so -lgobject-2.0 -lglib-2.0 -lm -pthread -Wl,-rpath -Wl,/home/em/dev/gnome-world-3.8/build/lib64 ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_symbol' ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_open' ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_supported' ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_close' ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_error' ../../gtk/.libs/libgtk-x11-2.0.so: error: undefined reference to 'g_module_build_path' collect2: error: ld returned 1 exit status make[4]: *** [testing] Error 1 (Occurred under jhbuild on a Debian machine with binutils-gold installed)
Created attachment 234743 [details] [review] build: Fix building with the gold linker by referencing gmodule-2.0 With the binutils-gold linker the '--no-copy-dt-needed-entries' flag is active by default and using any symbol from indirectly loaded libraries will result in undefined reference errors.
Attachment 234743 [details] pushed as 65ea14d - build: Fix building with the gold linker by referencing gmodule-2.0
*** Bug 684787 has been marked as a duplicate of this bug. ***