All of lore.kernel.org
 help / color / mirror / Atom feed
* PIC register 'bx' clobbered in 'asm' - xen-unstable build error
@ 2005-02-25 21:02 David F Barrera
  2005-02-25 21:17 ` Jerone Young
  2005-02-25 21:21 ` Bin Ren
  0 siblings, 2 replies; 5+ messages in thread
From: David F Barrera @ 2005-02-25 21:02 UTC (permalink / raw)
  To: xen-devel

I am trying to build xen-unstable on an x86 box, but it is failing with 
the following message:

gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
../../tools/libxutil -I. -Wp,-MD,.xc_rrobin.opic.d -fPIC -c -o 
xc_rrobin.opic xc_rrobin.c
gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
../../tools/libxutil -I. -Wp,-MD,.xc_vmx_build.opic.d -fPIC -c -o 
xc_vmx_build.opic xc_vmx_build.c
xc_vmx_build.c: In function `vmx_identify':
xc_vmx_build.c:468: error: PIC register `bx' clobbered in `asm'
make[4]: *** [xc_vmx_build.opic] Error 1
make[4]: Leaving directory `/tmp/xen-unstable/tools/libxc'
make[3]: *** [all] Error 2
make[3]: Leaving directory `/tmp/xen-unstable/tools/libxc'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/tmp/xen-unstable/tools'
make[1]: *** [tools] Error 2
make[1]: Leaving directory `/tmp/xen-unstable'
make: *** [world] Error 2
make world failed

I have built xen-unstable on this machine before, so I don't believe it 
is a setup problem.  Has anyone else observed this?

David F Barrera



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PIC register 'bx' clobbered in 'asm' - xen-unstable build error
  2005-02-25 21:02 PIC register 'bx' clobbered in 'asm' - xen-unstable build error David F Barrera
@ 2005-02-25 21:17 ` Jerone Young
  2005-02-25 21:44   ` Anthony Liguori
       [not found]   ` <mailman.1109368025.9618@unix-os.sc.intel.com>
  2005-02-25 21:21 ` Bin Ren
  1 sibling, 2 replies; 5+ messages in thread
From: Jerone Young @ 2005-02-25 21:17 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel

The big question is why are you clobbering bx , dx registers on get
cpuid:

	_asm__ __volatile__ ("cpuid"
                          : "=a" (eax), "=c" (ecx)
                          : "0" (1)
                          : "bx", "dx");

You can change this to:
	
		_asm__ __volatile__ ("cpuid"
                          : "=a" (eax), "=c" (ecx)
                          : "0" (1)
			  );

But I am not sure why this is there?


	
On Fri, 2005-02-25 at 15:02 -0600, David F Barrera wrote:
> I am trying to build xen-unstable on an x86 box, but it is failing with 
> the following message:
> 
> gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
> ../../tools/libxutil -I. -Wp,-MD,.xc_rrobin.opic.d -fPIC -c -o 
> xc_rrobin.opic xc_rrobin.c
> gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
> ../../tools/libxutil -I. -Wp,-MD,.xc_vmx_build.opic.d -fPIC -c -o 
> xc_vmx_build.opic xc_vmx_build.c
> xc_vmx_build.c: In function `vmx_identify':
> xc_vmx_build.c:468: error: PIC register `bx' clobbered in `asm'
> make[4]: *** [xc_vmx_build.opic] Error 1
> make[4]: Leaving directory `/tmp/xen-unstable/tools/libxc'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory `/tmp/xen-unstable/tools/libxc'
> make[2]: *** [install] Error 2
> make[2]: Leaving directory `/tmp/xen-unstable/tools'
> make[1]: *** [tools] Error 2
> make[1]: Leaving directory `/tmp/xen-unstable'
> make: *** [world] Error 2
> make world failed
> 
> I have built xen-unstable on this machine before, so I don't believe it 
> is a setup problem.  Has anyone else observed this?
> 
> David F Barrera
> 
> 
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
> 
-- 
Jerone Young
Open Virtualization
IBM Linux Technology Center
jyoung5@us.ibm.com
512-838-1157 (T/L: 678-1157)



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PIC register 'bx' clobbered in 'asm' - xen-unstable build error
  2005-02-25 21:02 PIC register 'bx' clobbered in 'asm' - xen-unstable build error David F Barrera
  2005-02-25 21:17 ` Jerone Young
@ 2005-02-25 21:21 ` Bin Ren
  1 sibling, 0 replies; 5+ messages in thread
From: Bin Ren @ 2005-02-25 21:21 UTC (permalink / raw)
  To: David F Barrera; +Cc: xen-devel

A patch has been proposed by Vincent Hanquez. I've already pushed it
into the unstable tree. The problem happens with gcc 3.4

Bin

--- xeno-unstable.bk/tools/libxc/xc_vmx_build.c.orig    2005-02-09
13:50:48 +0100
+++ xeno-unstable.bk/tools/libxc/xc_vmx_build.c 2005-02-09 13:51:33 +0100
@@ -426,10 +426,10 @@
{
    int eax, ecx;

-    __asm__ __volatile__ ("cpuid"
+    __asm__ __volatile__ ("pushl %%ebx; cpuid; popl %%ebx"
                         : "=a" (eax), "=c" (ecx)
                         : "0" (1)
-                         : "bx", "dx");
+                         : "dx");
    if (!(ecx & VMX_FEATURE_FLAG)) {
        return -1;
    }


On Fri, 25 Feb 2005 15:02:30 -0600, David F Barrera <dfbp@us.ibm.com> wrote:
> I am trying to build xen-unstable on an x86 box, but it is failing with
> the following message:
> 
> gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I
> ../../tools/libxutil -I. -Wp,-MD,.xc_rrobin.opic.d -fPIC -c -o
> xc_rrobin.opic xc_rrobin.c
> gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I
> ../../tools/libxutil -I. -Wp,-MD,.xc_vmx_build.opic.d -fPIC -c -o
> xc_vmx_build.opic xc_vmx_build.c
> xc_vmx_build.c: In function `vmx_identify':
> xc_vmx_build.c:468: error: PIC register `bx' clobbered in `asm'
> make[4]: *** [xc_vmx_build.opic] Error 1
> make[4]: Leaving directory `/tmp/xen-unstable/tools/libxc'
> make[3]: *** [all] Error 2
> make[3]: Leaving directory `/tmp/xen-unstable/tools/libxc'
> make[2]: *** [install] Error 2
> make[2]: Leaving directory `/tmp/xen-unstable/tools'
> make[1]: *** [tools] Error 2
> make[1]: Leaving directory `/tmp/xen-unstable'
> make: *** [world] Error 2
> make world failed
> 
> I have built xen-unstable on this machine before, so I don't believe it
> is a setup problem.  Has anyone else observed this?
> 
> David F Barrera
> 
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/xen-devel
> 


-- 
Every act of creation is first of all an act of destruction.
- Pablo Picasso


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PIC register 'bx' clobbered in 'asm' - xen-unstable build error
  2005-02-25 21:17 ` Jerone Young
@ 2005-02-25 21:44   ` Anthony Liguori
       [not found]   ` <mailman.1109368025.9618@unix-os.sc.intel.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Anthony Liguori @ 2005-02-25 21:44 UTC (permalink / raw)
  To: Jerone Young; +Cc: David F Barrera, xen-devel

Jerone Young wrote:

>The big question is why are you clobbering bx , dx registers on get
>cpuid:
>  
>
CPUID returns information in eax, ebx, ecx, and edx.  With -fPIC you 
have to push ebx onto the stack before calling cpuid and pop it 
afterward as Bin points out is what the patch to xen-unstable does.

Regards,

>	_asm__ __volatile__ ("cpuid"
>                          : "=a" (eax), "=c" (ecx)
>                          : "0" (1)
>                          : "bx", "dx");
>
>You can change this to:
>	
>		_asm__ __volatile__ ("cpuid"
>                          : "=a" (eax), "=c" (ecx)
>                          : "0" (1)
>			  );
>
>But I am not sure why this is there?
>
>
>	
>On Fri, 2005-02-25 at 15:02 -0600, David F Barrera wrote:
>  
>
>>I am trying to build xen-unstable on an x86 box, but it is failing with 
>>the following message:
>>
>>gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
>>../../tools/libxutil -I. -Wp,-MD,.xc_rrobin.opic.d -fPIC -c -o 
>>xc_rrobin.opic xc_rrobin.c
>>gcc  -DPIC -m32 -march=i686 -Wall -Werror -O3 -fno-strict-aliasing -I 
>>../../tools/libxutil -I. -Wp,-MD,.xc_vmx_build.opic.d -fPIC -c -o 
>>xc_vmx_build.opic xc_vmx_build.c
>>xc_vmx_build.c: In function `vmx_identify':
>>xc_vmx_build.c:468: error: PIC register `bx' clobbered in `asm'
>>make[4]: *** [xc_vmx_build.opic] Error 1
>>make[4]: Leaving directory `/tmp/xen-unstable/tools/libxc'
>>make[3]: *** [all] Error 2
>>make[3]: Leaving directory `/tmp/xen-unstable/tools/libxc'
>>make[2]: *** [install] Error 2
>>make[2]: Leaving directory `/tmp/xen-unstable/tools'
>>make[1]: *** [tools] Error 2
>>make[1]: Leaving directory `/tmp/xen-unstable'
>>make: *** [world] Error 2
>>make world failed
>>
>>I have built xen-unstable on this machine before, so I don't believe it 
>>is a setup problem.  Has anyone else observed this?
>>
>>David F Barrera
>>
>>
>>
>>-------------------------------------------------------
>>SF email is sponsored by - The IT Product Guide
>>Read honest & candid reviews on hundreds of IT Products from real users.
>>Discover which products truly live up to the hype. Start reading now.
>>http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
>>_______________________________________________
>>Xen-devel mailing list
>>Xen-devel@lists.sourceforge.net
>>https://lists.sourceforge.net/lists/listinfo/xen-devel
>>
>>    
>>



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: PIC register 'bx' clobbered in 'asm' - xen-unstable build error
       [not found]   ` <mailman.1109368025.9618@unix-os.sc.intel.com>
@ 2005-02-25 23:19     ` Arun Sharma
  0 siblings, 0 replies; 5+ messages in thread
From: Arun Sharma @ 2005-02-25 23:19 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: xen-devel

On 2/25/2005 1:44 PM, Anthony Liguori wrote:
> Jerone Young wrote:
> 
>> The big question is why are you clobbering bx , dx registers on get
>> cpuid:
>>  
>>
> CPUID returns information in eax, ebx, ecx, and edx.  With -fPIC you 
> have to push ebx onto the stack before calling cpuid and pop it 
> afterward as Bin points out is what the patch to xen-unstable does.

The compiler used to generate the push/pop just fine for gcc-3.3. This is an issue specific to gcc-3.4.

gcc-3.3 code:

(gdb) disassemble vmx_identify
Dump of assembler code for function vmx_identify:
0x00000000 <vmx_identify+0>:    push   %ebp
0x00000001 <vmx_identify+1>:    mov    $0x1,%eax
0x00000006 <.LC23+3>:   mov    %esp,%ebp
0x00000008 <.LC23+5>:   push   %ebx
0x00000009 <.LC23+6>:   cpuid
0x0000000b <.LC23+8>:   pop    %ebx
0x0000000c <.LC23+9>:   xor    %eax,%eax
0x0000000e <.LC23+11>:  test   $0x20,%cl
0x00000011 <.LC23+14>:  setne  %al
0x00000014 <.LC23+17>:  pop    %ebp
0x00000015 <.LC23+18>:  dec    %eax
0x00000016 <.LC23+19>:  ret
0x00000017 <.LC23+20>:  mov    %esi,%esi
0x00000019 <.LC23+22>:  lea    0x0(%edi),%edi
End of assembler dump.

I'm following up with compiler people here to understand why the compiler thinks this is a bug.

BTW <asm-i386/processor.h> has similar code.

	-Arun


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-25 23:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-25 21:02 PIC register 'bx' clobbered in 'asm' - xen-unstable build error David F Barrera
2005-02-25 21:17 ` Jerone Young
2005-02-25 21:44   ` Anthony Liguori
     [not found]   ` <mailman.1109368025.9618@unix-os.sc.intel.com>
2005-02-25 23:19     ` Arun Sharma
2005-02-25 21:21 ` Bin Ren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.