All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Michal Privoznik <mprivozn@redhat.com>, qemu-devel@nongnu.org
Cc: veroniabahaa@gmail.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] tests: Fix broken tcg test compilation
Date: Thu, 1 Sep 2016 09:30:27 -0500	[thread overview]
Message-ID: <0cf35ce3-1e7b-0a81-3d5c-bfa1396c5015@redhat.com> (raw)
In-Reply-To: <16b62ea67fcc34be255541423fbb1db9cdc1c258.1472720373.git.mprivozn@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1502 bytes --]

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 <mprivozn@redhat.com>
> ---
> 

> +++ 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

      reply	other threads:[~2016-09-01 14:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  9:02 [Qemu-devel] [PATCH] tests: Fix broken tcg test compilation Michal Privoznik
2016-09-01 14:30 ` Eric Blake [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0cf35ce3-1e7b-0a81-3d5c-bfa1396c5015@redhat.com \
    --to=eblake@redhat.com \
    --cc=mprivozn@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=veroniabahaa@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.