Compilation failed on current HEAD

Lars Knoll lars at trolltech.com
Wed Jul 13 02:06:21 PDT 2005


On Wednesday 13 July 2005 10:47, you wrote:
> On Wed, 2005-07-13 at 09:42 +0200, Lars Knoll wrote:
> > Hi,
> >
> > On Tuesday 12 July 2005 23:23, Peter Zijlstra wrote:
> > > Hi,
> > >
> > > I tried to build current HEAD; I needed the following patch to make it
> > > work.
> >
> > thanks for noting. I applied a slightly different patch (renaming uint
> > back to unsigned int).
> >
> > > Index: programs/Xserver/fb/fbmmx.c
> > > ===================================================================
> > > RCS file: /cvs/xorg/xc/programs/Xserver/fb/fbmmx.c,v
> > > retrieving revision 1.11
> > > diff -u -r1.11 fbmmx.c
> > > --- programs/Xserver/fb/fbmmx.c 12 Jul 2005 10:02:10 -0000      1.11
> > > +++ programs/Xserver/fb/fbmmx.c 12 Jul 2005 21:22:03 -0000
> >
> > ....
> >
> > > -        : "%eax", "%ebx", "%ecx", "%edx"
> > > +        : "%eax", "%ecx", "%edx"
> >
> > do you really need to remove "%ebx" in this line to get it to compile?
> > The reason I'm asking is that the assembler clobbers %ebx, so leaving it
> > out might lead to gcc generating wrong code.
>
> yes, gcc gives me this:
>   fbmmx.c:2311: error: PIC register `%ebx' clobbered in `asm'
>
> which of the two asm sections are you referring to; since the first
> (starting at line 2311) does a push/pop of ebx hence it should not be
> clobbered.
>
> as for the second asm section (as starting on line 2357) if cpuid
> clobbers ebx (I failed to check that) then indeed wrong code will be
> generated and a push/pop should be inserted around the code.

You're right. gcc 4 didn't give me a warning here. I'll add the push/pop pair 
and remove the ebx clobbering.

Lars



More information about the xorg mailing list