qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] tests: Fix broken tcg test compilation


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH] tests: Fix broken tcg test compilation
Date: Thu, 1 Sep 2016 09:30:27 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

On 09/01/2016 04:02 AM, Michal Privoznik wrote:
> The first build error to be seen is that linux-test.c fails to
> include cutils.h:
> 
> linux-test.c:42:25: fatal error: qemu/cutils.h: No such file or directory
> 
> This is because toplevel include/ dir is not put onto compiler's
> command line. After that:
> 
> qemu.git/include/qemu/cutils.h:171:1: error: unknown type name ‘bool’
> 
> So we need to include "qemu/osdep.h" which will define bool type
> for us. However, osdep.h eventually includes glib.h from system,
> therefore we need to put GLIB_CFLAGS onto compiler's command line
> too.
> 
> Lastly, getrusage is used in linux-test.c. This function and a
> struct it uses are defined in sys/resource.h:
> 
> linux-test.c:247:5: warning: implicit declaration of function ‘getrusage’
> 
> Signed-off-by: Michal Privoznik <address@hidden>
> ---
> 

> +++ b/tests/tcg/linux-test.c
> @@ -31,6 +31,7 @@
>  #include <utime.h>
>  #include <time.h>
>  #include <sys/time.h>
> +#include <sys/resource.h>
>  #include <sys/uio.h>
>  #include <sys/socket.h>
>  #include <netinet/in.h>
> @@ -39,6 +40,7 @@
>  #include <dirent.h>
>  #include <setjmp.h>
>  #include <sys/shm.h>
> +#include "qemu/osdep.h"

osdep.h has to be included first, before any system headers (in case it
sets defines that modify the behavior of those system headers).

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]