aports/main/gdb/cpuid-pic.patch
Natanael Copa f4d91e795b main/gdb: build fix
- Seem slike we need to run configure in opcodes separately.
- fix cpuid asm to not use ebx for our PIC
2013-04-29 08:11:04 +00:00

42 lines
1.2 KiB
Diff

--- ./gdb/common/linux-btrace.c.orig 2013-04-29 07:44:49.320273451 +0000
+++ ./gdb/common/linux-btrace.c 2013-04-29 08:05:02.111631215 +0000
@@ -342,10 +342,12 @@
#if defined __i386__ || defined __x86_64__
unsigned int cpuid, model, family;
- __asm__ __volatile__ ("movl $1, %%eax;"
+ __asm__ __volatile__ ("movl %%ebx, %%edi;"
+ "movl $1, %%eax;"
"cpuid;"
+ "movl %%edi, %%ebx;"
: "=a" (cpuid)
- :: "%ebx", "%ecx", "%edx");
+ :: "%ecx", "%edx", "%edi");
family = (cpuid >> 8) & 0xf;
model = (cpuid >> 4) & 0xf;
@@ -392,7 +394,8 @@
#if defined __i386__ || defined __x86_64__
char vendor[13];
- __asm__ __volatile__ ("xorl %%ebx, %%ebx;"
+ __asm__ __volatile__ ("movl %%ebx, %%edi;"
+ "xorl %%ebx, %%ebx;"
"xorl %%ecx, %%ecx;"
"xorl %%edx, %%edx;"
"movl $0, %%eax;"
@@ -400,11 +403,12 @@
"movl %%ebx, %0;"
"movl %%edx, %1;"
"movl %%ecx, %2;"
+ "movl %%edi, %%ebx;"
: "=m" (vendor[0]),
"=m" (vendor[4]),
"=m" (vendor[8])
:
- : "%eax", "%ebx", "%ecx", "%edx");
+ : "%eax", "%ecx", "%edx", "%edi");
vendor[12] = '\0';
if (strcmp (vendor, "GenuineIntel") == 0)