All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [PATCH] meson: fix botched compile check conversions
Date: Tue, 16 Nov 2021 12:00:04 +0000	[thread overview]
Message-ID: <YZOdRHZn9h9Rdjlr@redhat.com> (raw)
In-Reply-To: <CAFEAcA8=RsA37ErttuGKKfrb8Ooy9NJs=F4o4agQbgu=On9P5w@mail.gmail.com>

On Tue, Nov 16, 2021 at 11:51:16AM +0000, Peter Maydell wrote:
> On Tue, 16 Nov 2021 at 09:38, Paolo Bonzini <pbonzini@redhat.com> wrote:
> >
> > Fix a bunch of incorrect conversions from configure to Meson, which result
> > in different outcomes with --extra-cflags=-Werror.
> 
> FWIW this still won't give the right answer for the 'struct iovec'
> test if you include -Werror via --extra-cflags, because the
> generated code trips over an "expression result unused" warning:
> 
> 
> Running compile:
> Working directory:
> /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/meson-private/tmpeiz36t2n
> Command line:  clang-7 -m64 -mcx16
> /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/meson-private/tmpeiz36t2n/testfile.c
> -o /mnt/nvmedis
> k/linaro/qemu-from-laptop/qemu/build/arm-clang/meson-private/tmpeiz36t2n/output.obj
> -c -fsanitize=undefined -fno-sanitize=shift-base -Werror -D_FI
> LE_OFFSET_BITS=64 -O0 -Werror=implicit-function-declaration
> -Werror=unknown-warning-option -Werror=unused-command-line-argument
> -Werror=ignored-op
> timization-argument -std=gnu11
> 
> Code:
>  #include <sys/uio.h>
>         void bar(void) {
>             sizeof(struct iovec);
>         };
> Compiler stdout:
> 
> Compiler stderr:
>  /mnt/nvmedisk/linaro/qemu-from-laptop/qemu/build/arm-clang/meson-private/tmpeiz36t2n/testfile.c:3:13:
> error: expression result unused [-Werror,-Wunused-value]
>             sizeof(struct iovec);
>             ^~~~~~~~~~~~~~~~~~~~
> 1 error generated.
> 
> Checking for type "struct iovec" : NO
> 
> 
> But maybe we should just explicitly reject -Werror in --extra-cflags...

I wonder if the problem is more fundamental than that. Passing
stuff in --extra-cflags is done to influence the flags used to
compile the QEMU end user binaries. Unfortunately --extra-cflags
is also getting applied to all the meson.build feature checks.

IMHO we would get a more reliable result if the meson.build
checks were fully isolated from the cflags we used for building
everything else, so the checks get a well understood, predictable
environment.

IIUC, this current behaviour is a result of us adding cflags
using  add_global_arguments / add_project_arguments.

I wonder if we need to exclusively use the 'c_args' parameter
to library()/executable() and friends ?  The downside is of
course would be extra work to make sure we pass c_args in all
the right places.


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|



  reply	other threads:[~2021-11-16 12:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-16  9:38 [PATCH] meson: fix botched compile check conversions Paolo Bonzini
2021-11-16 11:13 ` Daniel P. Berrangé
2021-11-16 14:24   ` Paolo Bonzini
2021-11-16 11:51 ` Peter Maydell
2021-11-16 12:00   ` Daniel P. Berrangé [this message]
2021-11-16 13:10     ` Peter Maydell
2021-11-16 13:15       ` Daniel P. Berrangé
2021-11-16 14:31     ` Paolo Bonzini

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=YZOdRHZn9h9Rdjlr@redhat.com \
    --to=berrange@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 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.