Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 10194 - xfree 4.2.1-r1 link error
Summary: xfree 4.2.1-r1 link error
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Martin Schlemmer (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-04 07:41 UTC by Pat Double
Modified: 2003-02-04 19:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
xfree.log: output from ebuild xfree-4.2.1-r1.ebuild install (xfree.log,533.39 KB, text/plain)
2002-11-04 07:42 UTC, Pat Double
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pat Double 2002-11-04 07:41:06 UTC
I am trying to emerge xfree-4.2.1-r1 and am getting a large number of       
undefined reference errors in GL/mesa/src/libGLcore.a. I will attach the full       
ebuild log, but a short part is below. The system I am using was converted       
from a gcc 2.95.3 to gcc 3.2 with only the gcc 2.95.3 compiled c/c++ libraries       
intact. I am only using gcc 3.2. I have successfully compiled xfree 4.2.1. I      
have the following ebuilds installed that may be of help:      
     
 	glibc-2.3.1-r1     
	ccache-1.9-r1    
	nvidia-kernel-1.0.3123-r1   
	nvidia-glx-1.0.3123  
	  
USE="-gnome kde qt qtmt gtk2 -3dnow alsa apm pcmcia mmx sse sse2 gphoto2 pda 
cups dga opengl dvd pam ssl socks5 mozilla truetype java perl mysql pdflib 
xmms odbc acpi4linux" 
 
      
       
GL/mesa/src/libGLcore.a(logic.o)(.text+0xb): In function `_mesa_LogicOp':      
: undefined reference to `_glapi_Context'      
GL/mesa/src/libGLcore.a(masking.o)(.text+0xb): In function `_mesa_IndexMask':      
: undefined reference to `_glapi_Context'      
GL/mesa/src/libGLcore.a(masking.o)(.text+0xa1): In function `_mesa_ColorMask':      
: undefined reference to `_glapi_Context'      
GL/mesa/src/libGLcore.a(rastpos.o)(.text+0xf): more undefined references to      
`_glapi_Context' follow      
collect2: ld returned 1 exit status      
make[3]: *** [Xnest] Error 1      
make[3]: Leaving directory      
`/var/tmp/portage/xfree-4.2.1-r1/work/xc/programs/Xserver'      
make[2]: *** [install] Error 2      
make[2]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r1/work/xc/programs'      
make[1]: *** [install] Error 2      
make[1]: Leaving directory `/var/tmp/portage/xfree-4.2.1-r1/work/xc'      
make: *** [install] Error 2
Comment 1 Pat Double 2002-11-04 07:42:28 UTC
Created attachment 5365 [details]
xfree.log: output from ebuild xfree-4.2.1-r1.ebuild install

I made this file by running "ebuild xfree-4.2.1-r1.ebuild install" a second
time. I get the same results from emerge.
Comment 2 SpanKY gentoo-dev 2002-11-04 08:55:09 UTC
what happens if you emerge nvidia-kernel-1.0.3123 ? 
or what if you run `opengl-update xfree` and then emerge ? 
Comment 3 Pat Double 2002-11-04 09:55:11 UTC
emerge nvidia-kernel works fine. I tried opengl-update xfree and then emerge 
xfree, same results. I did notice that the same link errors appearing during 
compilation as well. I can do a clean compile and grab the entire log and 
attach if that would be helpful. 
Comment 4 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-04 11:35:03 UTC
Try without ccache ?  What version binutils ?
Comment 5 Pat Double 2002-11-04 12:28:12 UTC
binutils 2.13.90.0.10 
 
I will try without ccache although I don't think XFree actually uses it, it 
seems to find gcc itself. 
Comment 6 Pat Double 2002-11-04 16:42:04 UTC
Same results when compiling without ccache. 
Comment 7 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-05 13:30:06 UTC
Anything special that is not standard for a Gentoo system ?  I cannot recreate
this, so it makes things a bit difficult.
Comment 8 Pat Double 2002-11-05 17:32:13 UTC
I can't think of anything special. I'm using an up to date Gentoo unstable x86 
system (i.e. ~x86 in ACCEPT_KEYWORDS). Is there any diagnostic info I can 
upload? Such as the output from qpkg or similar? 
Comment 9 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-07 01:29:12 UTC
CFLAGS/CXXFLAGS ?
Comment 10 Pat Double 2002-11-07 05:39:23 UTC
CFLAGS="-O3 -pipe -march=pentium4 -mmmx -msse2 -mfpmath=sse   
-fexpensive-optimizations -fschedule-insns2 -fomit-frame-pointer -funroll-loops   
-frerun-cse-after-loop -frerun-loop-opt -falign-functions=4"   
   
CXXFLAGS="${CFLAGS}"   
  
CHOST="i686-pc-linux-gnu"  
  
I tried taking "mmx sse sse2" out of the USE flags, no difference. The only  
time I've had trouble with these flags is that I will get a gcc instruction  
error such as "instruction doesn't match constraints".  
  
I also, just to be sure, compiled xfree-4.2.1 yet again and it works fine.  
I tried remerging binutils, and no difference. 
 
I do seem to be the only one with this problem, two co-workers of mine have not 
experienced it. No email on the gentoo-user or gentoo-dev lists. 
 
I am using the KDE cvs ebuilds. Would that make a difference? I wouldn't think 
so, but perhaps. 
  
   
Comment 11 Pat Double 2002-11-07 08:19:17 UTC
Looks like a CFLAGS problem. I tried:    CFLAGS="-O2 -pipe" CXXFLAGS="-O2 -pipe" nice ebuild xfree-4.2.1-r1.ebuild clean install  and it works fine. Should've known, although I've never seen CFLAGS cause a linker error unless the build for mesa failed but the makefile carried on. I noticed this behavior with several of the xfree makefiles. During the compile this linker error appears several times although the build never stops.  I will experiment to find out which flag is the problem, probably the -msse -mfpmath=sse2. Would it be possible to update the ebuild to remove these similar to how the -march=pentium4 is changed to -march=pentium3 ? 
Comment 12 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-07 09:00:29 UTC
Hmm .. supposidly the 'strip-flags' should do it, but I guess I should recheck
it again ....
Comment 13 Pat Double 2002-11-07 11:33:59 UTC
I will systematically add flags and find the one that breaks and report back. 
Comment 14 Pat Double 2002-11-11 06:37:22 UTC
Yes, strip-flags works correctly. I tried using the following CFLAGS/CXXFLAGS and 
it worked: 
 
-O3 -pipe -march=i686 
 
However, using "pentium3" instead of "i686" did not work. Strange since I compiled 
xfree-4.2.1 with "pentium3" without problem. 
Comment 15 Martin Schlemmer (RETIRED) gentoo-dev 2002-11-11 14:03:03 UTC
Hmm .. compiled fine with -march=pentium3 here.  Wonder if it could be the cause
of other system libs being compiled with your more aggressive original flags...
Comment 16 Pat Double 2002-11-11 16:35:50 UTC
I suppose that could be the case. It would have to be a problem with the linker though 
as the optimized flags _shouldn't_ affect the export library symbols. I could try 
remerging binutils with more conservative flags and then emerge xfree. Although I 
can live with i686 optimizations. I'll try it tonight when I'm not using the machine. I 
have a snapshot of gcc 3.3, perhaps I could try that for fun :) 
Comment 17 Pat Double 2002-11-12 05:25:52 UTC
I remerged binutils with CFLAGS/CXXFLAGS="-O3 -pipe -march=i686" and then did emerge xfree which used my previously given flags. After flag-o-matic this is equivalent to "-O3 -pipe -march=pentium3". Worked fine. Looks like something in binutils, most probably the linker, doesn't work well with a flag I have. Might be time to filter more flags with flag-o-matic. 
Comment 18 Pat Double 2002-11-25 07:37:05 UTC
gcc 3.2.1 seems to have fixed this problem. After merging gcc 3.2.1, I merged binutils 
(the latest unstable) and xfree 4.2.1-r1 again and no problems. I'm certain this is 
related to the SSE fixes in gcc 3.2.1.