Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 585118

Summary: net-misc/spice-gtk-0.31[gtk3] with ld.gold: ./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XGetKeyboardControl'
Product: Gentoo Linux Reporter: Alexandre Rostovtsev (RETIRED) <tetromino>
Component: Current packagesAssignee: Virtualization Team <virtualization>
Status: RESOLVED FIXED    
Severity: normal CC: alex_y_xu, esigra, fosero, ormaaj
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/SPICE/spice-gtk/pull/3
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=97383
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 269315, 372079    
Attachments: net-misc/spice-gtk-0.31 build log
temporary workaround
Proper fix -- set X11_LIBS from pkg-config and put it in LIBADD

Description Alexandre Rostovtsev (RETIRED) gentoo-dev 2016-06-05 20:06:47 UTC
Created attachment 436582 [details]
net-misc/spice-gtk-0.31 build log

When building spice-gtk-0.31 with ld.gold, the build fails due to underlinking.

# binutils-config --linker ld.gold
# emerge -1 spice-gtk
[...]
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XGetKeyboardControl'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XGetPointerControl'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XChangePointerControl'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XkbGetMap'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XkbGetNames'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XkbFreeKeyboard'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XListExtensions'
./.libs/libspice-client-gtk-2.0.so: error: undefined reference to 'XFreeExtensionList'
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:1285: spicy] Error 1

If using ld.bfd, everything works (but probably only because ld.bfd failed to eliminate some unneeded objects even with --as-needed).
Comment 1 Chí-Thanh Christopher Nguyễn gentoo-dev 2016-07-04 10:20:16 UTC
I think you need to report this upstream too, or else it won't be fixed.
Comment 2 Jiří Moravec 2016-08-06 14:29:47 UTC
Created attachment 442680 [details, diff]
temporary workaround

Patch for ebuild which I'm using in my overlay
Comment 3 Ian Stakenvicius (RETIRED) gentoo-dev 2016-08-17 18:29:32 UTC
Created attachment 443616 [details, diff]
Proper fix -- set X11_LIBS from pkg-config and put it in LIBADD

Here's the proper fix.  Confirmed it works on version 0.31 (stable); I'll post it upstream after I check if it's relevant on newer versions as well.
Comment 4 Ian Stakenvicius (RETIRED) gentoo-dev 2016-08-17 20:19:34 UTC
Fix pushed to gentoo repo for all versioned packages.


commit c772ac4e3d9c439779e97994d752a4b7afb645c4
Author: Ian Stakenvicius <axs@gentoo.org>
Date:   Wed Aug 17 16:13:30 2016 -0400

    net-misc/spice-gtk: explicitly link libX11 the right way for ld.gold
    
    Bug: http://bugs.gentoo.org/585118
    
    Package-Manager: portage-2.2.28