Bug 97383 - underlinking: undefined reference to 'XGetPointerControl' [...]
Summary: underlinking: undefined reference to 'XGetPointerControl' [...]
Status: RESOLVED FIXED
Alias: None
Product: Spice
Classification: Unclassified
Component: spice-gtk (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Spice Bug List
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-17 13:43 UTC by Michał Górny
Modified: 2016-09-21 08:36 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Build log (for current git version) (486.07 KB, text/x-log)
2016-08-17 13:43 UTC, Michał Górny
Details
Patch adding necessary linkage (1.76 KB, patch)
2016-08-17 14:24 UTC, Michał Górny
Details | Splinter Review

Description Michał Górny 2016-08-17 13:43:23 UTC
Created attachment 125848 [details]
Build log (for current git version)

When attempting to build spice-gtk with the GNU gold linker, the build fails with the series of errors:

libtool: link: x86_64-pc-linux-gnu-gcc-5.4.0 -march=k8-sse3 -mcx16 -msahf --param l1-cache-size=64 --param l1-cache-line-size=64 --param l2-cache-size=512 -O2 -pipe -frecord-gcc-switches -Wl,-O1 -Wl,--hash-style=gnu -o .libs/spicy spicy-spicy.o spicy-spicy-connect.o spicy-spice-cmdline.o -pthread  -Wl,--as-needed ./.libs/libspice-client-gtk-3.0.so /tmp/portage/net-misc/spice-gtk-9999/work/spice-gtk-9999/src/.libs/libspice-client-glib-2.0.so ./.libs/libspice-client-glib-2.0.so -lcelt051 /usr/lib64/libopus.so -ljpeg -lz -llz4 -lpixman-1 -lssl -lcrypto -lusb-1.0 -lusbredirhost -lusbredirparser -lgthread-2.0 -lgtk-3 -lgdk-3 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lepoxy -lm -pthread
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XGetPointerControl'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XChangePointerControl'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XkbGetMap'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XkbGetNames'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XkbFreeKeyboard'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XListExtensions'
./.libs/libspice-client-gtk-3.0.so: error: undefined reference to 'XFreeExtensionList'
collect2: error: ld returned 1 exit status
distcc[5868] ERROR: compile (null) on localhost failed
make[4]: *** [Makefile:1151: spicy] Error 1

This indicates that the library is using some X11 APIs directly but not linking to appropriate X11 libraries.
Comment 1 Michał Górny 2016-08-17 14:03:49 UTC
It seems that some of the calls are conditional to GDK_WINDOWING_X11, and some to HAVE_X11_XKBLIB_H. The latter also lacks an appropriate --enable switch making it an automagic dependency.
Comment 2 Michał Górny 2016-08-17 14:24:21 UTC
Created attachment 125849 [details] [review]
Patch adding necessary linkage

Here's a patch that fixes the issue for me. It's based on the existing code, finds whether X11 backend is available and enforces libX11 linkage (via x11.pc) appropriately.
Comment 3 Marc-Andre Lureau 2016-09-21 08:36:06 UTC
Fixed in
https://cgit.freedesktop.org/spice/spice-gtk/commit/?id=11dcc17b0a01e9f06a3cc6dbb6051326779677e3

and subsequent commits


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.