Patchwork qemu-barrier: Fix compilation on i386 hosts

login
register
mail settings
Submitter Aurelien Jarno
Date Oct. 7, 2012, 6:10 p.m.
Message ID <20121007181016.GD4055@ohm.aurel32.net>
Download mbox | patch
Permalink /patch/189858/
State New
Headers show

Comments

Aurelien Jarno - Oct. 7, 2012, 6:10 p.m.
On Sun, Oct 07, 2012 at 04:10:41PM +0000, Blue Swirl wrote:
> On Sat, Oct 6, 2012 at 10:46 AM, Stefan Weil <sw@weilnetz.de> wrote:
> > Commit 610b823ef66b993660f1ab1447a769f190e4f3b3 uses QEMU_GNUC_PREREQ
> > on i386 hosts.
> >
> > That macro is defined in qemu-common.h which is not always included
> > before qemu-barrier.h, so compilation on i386 hosts was broken.
> 
> This broke sparc-softmmu build on i386:
>   CC    sparc-softmmu/hw/vhost_net.o
> In file included from /src/qemu/target-sparc/cpu.h:28,
>                  from /src/qemu/qemu-common.h:128,
>                  from /src/qemu/qemu-barrier.h:9,
>                  from /src/qemu/qemu-queue.h:81,
>                  from /src/qemu/net.h:4,
>                  from /src/qemu/hw/vhost_net.c:16:
> /src/qemu/cpu-defs.h:144: error: expected specifier-qualifier-list
> before 'QTAILQ_ENTRY'
> /src/qemu/cpu-defs.h:151: error: expected specifier-qualifier-list
> before 'QTAILQ_ENTRY'
> 
> I think the correct fix is to include compiler.h instead.
> 

Correct, I have been able to build QEMU on an i386 host that way. I have
therefore committed the following patch:


commit f1829782d6cb931973d71649f8ad1dad66188c34
Author: Aurelien Jarno <aurelien@aurel32.net>
Date:   Sun Oct 7 20:07:11 2012 +0200

    qemu-barrier: Fix compilation on i386 hosts
    
    Commit 1d31fca470648ec66afd8743491bfb5846306341 tried to fix bug
    introduced by 610b823ef66b993660f1ab1447a769f190e4f3b3 by including
    qemu-common.h, which breaks the build further.
    
    Include compiler.h instead, as suggested by Blue Swirl.
    
    Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>

Patch

diff --git a/qemu-barrier.h b/qemu-barrier.h
index 1de914e..faa83d2 100644
--- a/qemu-barrier.h
+++ b/qemu-barrier.h
@@ -6,7 +6,7 @@ 
 
 #if defined(__i386__)
 
-#include "qemu-common.h"        /* QEMU_GNUC_PREREQ */
+#include "compiler.h"        /* QEMU_GNUC_PREREQ */
 
 /*
  * Because of the strongly ordered x86 storage model, wmb() and rmb() are nops