From: Paolo Bonzini <pbonzini@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] meson: fix botched compile check conversions
Date: Tue, 16 Nov 2021 15:31:34 +0100 [thread overview]
Message-ID: <268647d0-725f-8c8c-82bc-f26c7f8cdeb0@redhat.com> (raw)
In-Reply-To: <YZOdRHZn9h9Rdjlr@redhat.com>
On 11/16/21 13:00, Daniel P. Berrangé wrote:
> 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.
No, it's not using add_global_arguments/add_project_arguments for
--extra-cflags.
The --extra-cflags (aka the CFLAGS envvar, or "meson setup -Dc_args") is
messy: on one hand it's kinda legacy (we have configure flags to set
-O2, -g, -Werror, etc.), on the other hand not really possible to kill
it because it's how distros expect to set flags such as -O2.
But it's full of pitfalls, and the only good use of it seems to be for
-I and -L flags. We already saw issues with it last week with distros
adding "-Wall" to CFLAGS or --extra-cflags and that gives you bogus
warnings. Unfortunately you certainly want flags such as -g to override
earlier flags, and you might even want -Wall to override earlier -Wno-*
flags *unless -Werror is in use*.
Apart from this, the sizeof() issue (which by the way I didn't see with
GCC) has to be fixed in Meson and is probably visible also in e.g.
has_members.
Paolo
prev parent reply other threads:[~2021-11-16 14:34 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é
2021-11-16 13:10 ` Peter Maydell
2021-11-16 13:15 ` Daniel P. Berrangé
2021-11-16 14:31 ` Paolo Bonzini [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=268647d0-725f-8c8c-82bc-f26c7f8cdeb0@redhat.com \
--to=pbonzini@redhat.com \
--cc=berrange@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).