[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Qemu and GCC-3.4 on powerpc



Hello,

the version 0.8.0 of qemu in the Debian-pool will not compile on
PowerPC with GCC 3.4. The following patch will fix it:

--- cpu-all.h~	2005-12-19 23:51:53.000000000 +0100
+++ cpu-all.h	2006-03-27 22:47:54.291613000 +0200
@@ -249,15 +249,11 @@
 
 static inline void stl_le_p(void *ptr, int v)
 {
-#ifdef __powerpc__
-    __asm__ __volatile__ ("stwbrx %1,0,%2" : "=m" (*(uint32_t *)ptr) : "r" (v), "r" (ptr));
-#else
     uint8_t *p = ptr;
     p[0] = v;
     p[1] = v >> 8;
     p[2] = v >> 16;
     p[3] = v >> 24;
-#endif
 }
 
 static inline void stq_le_p(void *ptr, uint64_t v)


If I use GCC 3.3, then qemu compiles with the assembler instruction in
the patch above, but qemu does not work correctly (tested with Knoppix V5.0). 

If I try to compile qemu with GCC 3.4 without the patch I get the following error:

qemu-0.8.0/linux-user/elfload.c: In function `load_elf_binary':
qemu-0.8.0/cpu-all.h:253: error: inconsistent operand constraints in an `asm'
qemu-0.8.0/cpu-all.h:253: error: inconsistent operand constraints in an `asm'

But if I copy the function stl_le_p to a seperate file, the function
will compile with GCC 3.4. 

Is this a bug in qemu, or is it a bug in GCC 3.4?


Greetings,

	Dieter Schuster

-- 
GnuPG Key-ID: 1024D/5EE6EF26, bitte verschlüsselte E-Post; keine HTML-Post.

Keine Logik-/Softwarepatente. Pas de Brevets Logique/Logiciels. 
No Logic/Software Patents. 

Attachment: pgpIEMyfTsyeB.pgp
Description: PGP signature


Reply to: