I try to rebuild hwinfo at RHEL for 64-bit. But there are some errors:


gcc -c -Wall -O2 -pipe -g -fPIC  -I../../src/hd cpu.c
{standard input}: Assembler messages:
{standard input}:368: Error: suffix or operands invalid for `push'
{standard input}:373: Error: suffix or operands invalid for `pop'

and I found the reason is:

Instructions that modify the stack (push, pop, call, ret, enter, and
leave) are implicitly 64-bit.

I fix the source as the following:

--- hwinfo-8.99.old/src/hd/cpu.c        2007-03-28 10:13:42.000000000 +0800
+++ hwinfo-8.99/src/hd/cpu.c    2007-03-28 10:16:57.000000000 +0800
@@ -494,19 +494,30 @@
   ADD2LOG("----- /proc/cpuinfo end -----\n");
 }

-
 #if defined(__i386__) || defined(__x86_64__)
 inline unsigned units_per_cpu()
 {
   unsigned u;

   asm(
+#if defined(__i386__)
     "push %%ebx\n\t"
+#else
+    "push %%rbx\n\t"
+#endif
     "mov $1,%%eax\n\t"
     "cpuid\n\t"
+#if defined(__i386__)
     "shr $8,%%ebx\n\t"
+#else
+    "shr $8,%%rbx\n\t"
+#endif
     "movzx %%bh,%%eax\n\t"
+#if defined(__i386__)
     "pop %%ebx"
+#else
+    "pop %%rbx"
+#endif
     : "=a" (u)
     :: "%ecx", "%edx"
   );

Anyone have met this status?

Thanks
Zhao
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to