Bug 24166 - xvidtune 1.0.1 fails to compile if the system linker is gold
Summary: xvidtune 1.0.1 fails to compile if the system linker is gold
Status: RESOLVED FIXED
Alias: None
Product: xorg
Classification: Unclassified
Component: * Other (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-09-26 06:46 UTC by Bernhard Rosenkraenzer
Modified: 2009-09-26 09:57 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Fix (369 bytes, patch)
2009-09-26 06:46 UTC, Bernhard Rosenkraenzer
no flags Details | Splinter Review

Description Bernhard Rosenkraenzer 2009-09-26 06:46:33 UTC
Created attachment 29859 [details] [review]
Fix

Attempting to build xvidtune with /usr/bin/ld == gold
[http://en.wikipedia.org/wiki/Gold_(linker)], results in

/usr/bin/ld: xvidtune-xvidtune.o: in function ApplyCB:xvidtune.c:345: error: undefined reference to 'XSync'
/usr/bin/ld: xvidtune-xvidtune.o: in function ApplyCB:xvidtune.c:347: error: undefined reference to 'XBell'
/usr/bin/ld: xvidtune-xvidtune.o: in function AdjustCB:xvidtune.c:661: error: undefined reference to 'XBell'
/usr/bin/ld: xvidtune-xvidtune.o: in function ConvertSelection:xvidtune.c:515: error: undefined reference to 'XmuConvertStandardSelection'
/usr/bin/ld: xvidtune-xvidtune.o: in function CleanUp:xvidtune.c:157: error: undefined reference to 'XFlush'
/usr/bin/ld: xvidtune-xvidtune.o: in function ChangeBlankCB:xvidtune.c:844: error: undefined reference to 'XBell'
/usr/bin/ld: xvidtune-xvidtune.o: in function BlankEditCB:xvidtune.c:805: error: undefined reference to 'XBell'
/usr/bin/ld: xvidtune-xvidtune.o: in function TestCB:xvidtune.c:500: error: undefined reference to 'XSync'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1582: error: undefined reference to 'XSync'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1609: error: undefined reference to 'XSetErrorHandler'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1648: error: undefined reference to 'XInternAtom'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1650: error: undefined reference to 'XSetWMProtocols'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1652: error: undefined reference to 'XMapWindow'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1648: error: undefined reference to 'XInternAtom'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1650: error: undefined reference to 'XSetWMProtocols'
/usr/bin/ld: xvidtune-xvidtune.o: in function main:xvidtune.c:1652: error: undefined reference to 'XMapWindow'
collect2: ld returned 1 exit status


The problem is that xvidtune uses these symbols from libX11 directly while not linking directly to libX11 (libX11 is dragged in through linking to libXaw and libXt -- but gold doesn't follow references to indirectly linked libraries anymore).

The same goes for libXmu (xvidtune uses XmuConvertStandardSelection).

Attaching fix.
Comment 1 Alan Coopersmith 2009-09-26 09:57:56 UTC
There should be no libraries listed on the xvidtune_LDADD line in Makefile.am
To add new library dependencies they need to be specified in the 
PKG_CHECK_MODULES line in configure.ac.   Committed this instead:

commit 19f177db7c50aac512761ddbd79c0344d7dc04de
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Sat Sep 26 09:55:44 2009 -0700

    Add xmu & x11 to PKG_CHECK_MODULES
    
    http://bugs.freedesktop.org/show_bug.cgi?id=24166
    Reported by: Bernhard Rosenkraenzer <bero@arklinux.org>
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>

diff --git a/configure.ac b/configure.ac
index 41a81aa..d76b750 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,7 +35,7 @@ AC_PROG_CC
 AC_PROG_INSTALL
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XVIDTUNE, xxf86vm xt xaw7)
+PKG_CHECK_MODULES(XVIDTUNE, xxf86vm xt xaw7 xmu x11)
 xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt)
 AC_ARG_WITH(appdefaultdir,
        AC_HELP_STRING([--with-appdefaultdir=<pathname>],


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.