qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: peter.maydell@linaro.org, Paolo Bonzini <pbonzini@redhat.com>,
	jtomko@redhat.com, qemu-devel@nongnu.org, jingqi.liu@intel.com
Subject: Re: [PATCH 1/2] Use -isystem for linux-headers dir
Date: Wed, 11 Mar 2020 19:05:45 -0400	[thread overview]
Message-ID: <20200311190458-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20200311225130.1599619-2-ehabkost@redhat.com>

On Wed, Mar 11, 2020 at 06:51:29PM -0400, Eduardo Habkost wrote:
> glibc and Linux-provided headers are known to generate macro
> redefinition warnings when used together.  For example:
> <linux/mman.h> and <sys/mman.h> duplicate some macro definitions.
> 
> We normally never see those warnings because GCC suppresses
> warnings generated by system headers.  We carry our own copy of
> Linux header files, though, and this makes those warnings not be
> suppressed when glibc headers are included before Linux headers
> (e.g. if <sys/mman.h> is included before <linux/mman.h>).
> 
> Use -isystem instead of -I for linux-headers.  This makes the
> compiler treat our linux-headers directory the same way it treats
> system-provided Linux headers, and suppress warnings generated by
> them.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  Makefile.target | 2 +-
>  configure       | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Makefile.target b/Makefile.target
> index 2d43dc586a..934a9f7431 100644
> --- a/Makefile.target
> +++ b/Makefile.target
> @@ -12,7 +12,7 @@ endif
>  
>  $(call set-vpath, $(SRC_PATH):$(BUILD_DIR))
>  ifdef CONFIG_LINUX
> -QEMU_CFLAGS += -I../linux-headers
> +QEMU_CFLAGS += -isystem ../linux-headers
>  endif
>  QEMU_CFLAGS += -iquote .. -iquote $(SRC_PATH)/target/$(TARGET_BASE_ARCH) -DNEED_CPU_H
>  
> diff --git a/configure b/configure
> index cbf864bff1..04a2a7f2dd 100755
> --- a/configure
> +++ b/configure
> @@ -899,7 +899,7 @@ Linux)
>    linux="yes"
>    linux_user="yes"
>    kvm="yes"
> -  QEMU_INCLUDES="-I\$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"
> +  QEMU_INCLUDES="-isystem \$(SRC_PATH)/linux-headers -I$PWD/linux-headers $QEMU_INCLUDES"

Shouldn't both be -isystem?

>    supported_os="yes"
>    libudev="yes"
>  ;;
> -- 
> 2.24.1



  reply	other threads:[~2020-03-11 23:06 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-11 22:51 [PATCH 0/2] Fix MAP_SYNC support when host has older glibc version Eduardo Habkost
2020-03-11 22:51 ` [PATCH 1/2] Use -isystem for linux-headers dir Eduardo Habkost
2020-03-11 23:05   ` Michael S. Tsirkin [this message]
2020-03-11 23:08     ` Eduardo Habkost
2020-03-11 23:15       ` Eduardo Habkost
2020-03-12  5:28       ` Michael S. Tsirkin
2020-03-11 22:51 ` [PATCH 2/2] mmap-alloc: Include osdep.h before checking CONFIG_LINUX Eduardo Habkost
2020-03-11 23:06   ` Michael S. Tsirkin
2020-03-11 23:40 ` [PATCH 0/2] Fix MAP_SYNC support when host has older glibc version no-reply

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=20200311190458-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jingqi.liu@intel.com \
    --cc=jtomko@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).