Skip to contentSkip to conversation

compilation fix

Qemu-devel Mattias Nissler 1 participant 1 message Jan 10, 2006

lore
Share & tools
lore
#0 lore raw

Hi,

I'm running the gentoo version of gcc-3.4.5 on my ppc system here. The patch below is required to make qemu compile cleanly for me. The compiler gives me some very unintuitive error message from within an __asm__ statement but the fix is rather trivial.

The patch fixes line 746 of linux-user/elfload.c:

        if (k_platform)
            NEW_AUX_ENT(AT_PLATFORM, (target_ulong) u_platform);

In the original definition NEW_AUX_ENT expanded to several statements of which only the first will be dependant on the if statement above. I guess the patch changes the code to the way it was actually intended.

Mattias

linux-user/elfload.c 2006-01-10 01:35:54.000000000 +0100 renamed from linux-user/elfload.c 2006-01-10 01:35:28.000000000 +0100 +3 -1
@@ -723,9 +723,11 @@
             sp -= ((unsigned long)csp & 15UL) / sizeof(*sp);
 
 #define NEW_AUX_ENT(id, val) \
+({ \
           sp -= 2; \
           put_user (id, sp); \
-          put_user (val, sp + 1)
+          put_user (val, sp + 1); \
+})
         NEW_AUX_ENT (AT_NULL, 0);
 
         /* There must be exactly DLINFO_ITEMS entries here.  */