#1547 X-Chat fails to build with glib-2.32.3

open
nobody
None
5
2012-06-08
2012-06-08
Palmer Dabbelt
No

When trying to build X-Chat (from either Gentoo's package for 2.8.8 or the subversion r1508) I get the following error when trying to link

libtool: link: x86_64-pc-linux-gnu-gcc -O2 -pipe -Wall -Wno-pointer-sign -funsigned-char -I/usr/include/freetype2 -Wl,-O1 -o xchat about.o ascii.o banlist.o chanlist.o chanview.o custom-list.o dccgui.o editlist.o fe-gtk.o fkeys.o gtkutil.o ignoregui.o joind.o menu.o maingui.o notifygui.o palette.o pixmaps.o plugin-tray.o plugingui.o rawlog.o search.o servlistgui.o setup.o textgui.o urlgrab.o userlistgui.o xtext.o -Wl,--version-script -Wl,./../version-script -Wl,--export-dynamic -pthread ../common/libxchatcommon.a -lgtkspell -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lXext -lX11 -lssl -lcrypto -ldl -lrt -lglib-2.0 -pthread
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: plugin-tray.o: undefined reference to symbol 'g_module_symbol'
/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld: note: 'g_module_symbol' is defined in DSO /usr/lib/libgmodule-2.0.so.0 so try adding it to the linker command line
/usr/lib/libgmodule-2.0.so.0: could not read symbols: Invalid operation

I believe the problem comes from libgmodule-2.0.so not being pulled in by libglib-2.0.so and that the suggested fix is correct. I think this is a change in the new version of glib (2.32) because it doesn't happen with my old glib (2.30).

I've attached a patch that adds an autoconf test to make sure "g_module_symbol" exists in libglib-2.0.so and if it's not there add -lgmodule-2.0 to the link library list.

Discussion

  • Palmer Dabbelt
    Palmer Dabbelt
    2012-06-08

    The patch described by my bug report

     
  • Palmer Dabbelt
    Palmer Dabbelt
    2012-06-08

    A cleaner version of "xchat_libgmodule.patch"

     
  • I have a different patch that uses pkg-config like it should be.