Package: hwinfo
Version: 8.38-3
Severity: normal
Tags: patch

When building 'hwinfo' on amd64/unstable,
I get the following error:

gcc -c -Wall -O2 -pipe -g   -I../../src/hd cpu.c
{standard input}: Assembler messages:
{standard input}:386: Error: suffix or operands invalid for `push'
{standard input}:391: Error: suffix or operands invalid for `pop'
make[4]: *** [cpu.o] Error 1
make[4]: Leaving directory `/hwinfo-8.38/build-tree/hwinfo-8.38/src/hd'

With the attached patch 'hwinfo' can be compiled on amd64.

The patch also contains the gcc4 fix from #304079.

Regards
Andreas Jochens

diff -urN ../tmp-orig/hwinfo-8.38/debian/patches/830_amd64_fix 
./debian/patches/amd64_fix
--- ../tmp-orig/hwinfo-8.38/debian/patches/830_amd64_fix        1970-01-01 
00:00:00.000000000 +0000
+++ ./debian/patches/830_amd64_fix      2005-09-20 06:57:40.000000000 +0000
@@ -0,0 +1,24 @@
+diff -urN ../hwinfo-8.38/src/hd/cpu.c hwinfo-8.38/src/hd/cpu.c
+--- ../hwinfo-8.38/src/hd/cpu.c        2004-02-20 10:51:02.000000000 +0000
++++ hwinfo-8.38/src/hd/cpu.c   2005-09-20 06:56:47.000000000 +0000
+@@ -501,12 +501,20 @@
+   unsigned u;
+ 
+   asm(
++#ifdef __x86_64__
++    "push %%rbx\n\t"
++#else
+     "push %%ebx\n\t"
++#endif
+     "mov $1,%%eax\n\t"
+     "cpuid\n\t"
+     "shr $8,%%ebx\n\t"
+     "movzx %%bh,%%eax\n\t"
++#ifdef __x86_64__
++    "pop %%rbx"
++#else
+     "pop %%ebx"
++#endif
+     : "=a" (u)
+     :: "%ecx", "%edx"
+   );
diff -urN ../tmp-orig/hwinfo-8.38/debian/patches/820_gcc4_fix 
./debian/patches/820_gcc4_fix
--- ../tmp-orig/hwinfo-8.38/debian/patches/820_gcc4_fix 1970-01-01 
00:00:00.000000000 +0000
+++ ./debian/patches/820_gcc4_fix       2005-09-20 06:51:28.000000000 +0000
@@ -0,0 +1,70 @@
+diff -urN tmp/src/int10/i10_v86.c hwinfo-8.38/src/int10/i10_v86.c
+--- tmp/src/int10/i10_v86.c    2003-10-28 11:44:31.000000000 +0100
++++ hwinfo-8.38/src/int10/i10_v86.c    2005-04-10 15:16:13.637536983 +0200
+@@ -230,7 +230,8 @@
+                                                                               
SEG_ADR((CARD8 *),es,di),
+                                                                               
CPU_REG_LW(eflags)&DF,
+                                                                               
(is_rep? LWECX:1));
+-              if (is_rep) LWECX = 0;
++              if (is_rep) { if (prefix66 ^ prefix67) CPU_REG(ecx) = 0; else 
CPU_REG_LW(ecx) = 0;}
++
+               CPU_REG_LW(eip)++;
+               break;
+ 
+@@ -249,7 +250,7 @@
+                                                                               
        CPU_REG_LW(eflags)&DF,
+                                                                               
        (is_rep? LWECX:1));
+               }
+-              if (is_rep) LWECX = 0;
++              if (is_rep) { if (prefix66 ^ prefix67) CPU_REG(ecx) = 0; else 
CPU_REG_LW(ecx) = 0;}
+               CPU_REG_LW(eip)++;
+               break;
+ 
+@@ -259,7 +260,7 @@
+               CPU_REG_LW(esi) += 
port_rep_outb(CPU_REG_LW(edx),(CARD8*)INT2PTR(LIN_PREF_SI),
+                                                                               
 CPU_REG_LW(eflags)&DF,
+                                                                               
 (is_rep? LWECX:1));
+-              if (is_rep) LWECX = 0;
++              if (is_rep) { if (prefix66 ^ prefix67) CPU_REG(ecx) = 0; else 
CPU_REG_LW(ecx) = 0;}
+               CPU_REG_LW(eip)++;
+               break;
+ 
+@@ -278,7 +279,7 @@
+                                                                               
         CPU_REG_LW(eflags)&DF,
+                                                                               
         (is_rep? LWECX:1));
+               } 
+-              if (is_rep) LWECX = 0;
++              if (is_rep) { if (prefix66 ^ prefix67) CPU_REG(ecx) = 0; else 
CPU_REG_LW(ecx) = 0;}
+               CPU_REG_LW(eip)++;
+               break;
+ 
+diff -urN tmp/src/ids/check_hd.c hwinfo-8.38/src/ids/check_hd.c
+--- tmp/src/ids/check_hd.c     2003-09-08 18:30:31.000000000 +0200
++++ hwinfo-8.38/src/ids/check_hd.c     2005-04-10 19:42:41.546703368 +0200
+@@ -2818,7 +2818,7 @@
+     hddb.strings_len, hddb.strings_len
+   );
+ 
+-  fprintf(f, "hddb_list_t hddb_internal_list[%u] = {\n", hddb.list_len);
++  fprintf(f, "static hddb_list_t hddb_internal_list[%u] = {\n", 
hddb.list_len);
+   for(u = 0; u < hddb.list_len; u++) {
+     fprintf(f,
+     "  { 0x%08x, 0x%08x, 0x%08x, 0x%08x }%s\n",
+@@ -2829,7 +2829,7 @@
+   }
+   fprintf(f, "};\n\n");
+ 
+-  fprintf(f, "unsigned hddb_internal_ids[%u] = {\n", hddb.ids_len);
++  fprintf(f, "static unsigned hddb_internal_ids[%u] = {\n", hddb.ids_len);
+   for(u = 0; u < hddb.ids_len; u++) {
+     if((u % 6) == 0) fputc(' ', f);
+     fprintf(f, " 0x%08x", hddb.ids[u]);
+@@ -2840,7 +2840,7 @@
+ 
+   qstr = quote_string(hddb.strings, hddb.strings_len);
+   qstr_len = qstr ? strlen(qstr) : 0;
+-  fprintf(f, "char hddb_internal_strings[%u] = \"\\\n", hddb.strings_len);
++  fprintf(f, "static char hddb_internal_strings[%u] = \"\\\n", 
hddb.strings_len);
+   for(u = 0; u < qstr_len; ) {
+     len = qstr_len - u;
+     if(len > 72) len = 72;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to