Bug 29958

Summary: link error due to _X_HIDDEN in libXext-1.1.2
Product: xorg Reporter: Ivan Jager <aij+freedesktop.org>
Component: Lib/XextAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
add _X_HIDDEN to the definition of xgeExtRegister none

Description Ivan Jager 2010-09-01 17:35:20 UTC
Created attachment 38376 [details] [review]
add _X_HIDDEN to the definition of xgeExtRegister

Compiling libXext in gentoo-prefix, I was getting a link error for xgeExtRegister. The problem is that extutil.c declares it with _X_HIDDEN but Xge.c defines it without. I'm not entirely sure why, but that causes the following error when linking the dynamic library on amd64:

Xge.c:299: warning: no previous prototype for 'xgeExtRegister'
  CCLD   libXext.la
/afs/mrph.org/sys/gentoo/amd64_linux26/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/bin/ld: .libs/extutil.o: relocation R_X86_64_PC32 against symbol `xgeExtRegister' can not be used when making a shared object; recompile with -fPIC
/afs/mrph.org/sys/gentoo/amd64_linux26/usr/lib/gcc/x86_64-pc-linux-gnu/4.2.4/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[2]: *** [libXext.la] Error 1
make[2]: Leaving directory `/var/tmp/portage/x11-libs/libXext-1.1.2/work/libXext-1.1.2/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/x11-libs/libXext-1.1.2/work/libXext-1.1.2'
make: *** [all] Error 2


I attached a 1-line patch which fixes the problem for me.
Comment 1 Alan Hourihane 2011-02-25 03:11:25 UTC
Oh, just noticed this in bugzilla after I've committed the same fix. Closing.

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.