From: Paolo Bonzini <pbonzini@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
Roman Bolshakov <r.bolshakov@yadro.com>,
Christian Schoenebeck <qemu_oss@crudebyte.com>,
Akihiko Odaki <akihiko.odaki@gmail.com>
Subject: Re: [PATCH v2 6/8] configure: Pass filtered QEMU_OBJCFLAGS to meson
Date: Fri, 18 Feb 2022 16:44:29 +0100 [thread overview]
Message-ID: <c892e4b7-ea41-39ea-213f-0b980eef1106@redhat.com> (raw)
In-Reply-To: <20220215170106.95848-7-f4bug@amsat.org>
On 2/15/22 18:01, Philippe Mathieu-Daudé via wrote:
> Filter unsupported Objective-C options, to avoid
> 'unknown-warning-option' warnings when using Clang:
>
> [34/373] Compiling Objective-C object libcommon.fa.p/audio_coreaudio.m.o
> warning: unknown warning option '-Wold-style-declaration'; did you mean '-Wout-of-line-declaration'? [-Wunknown-warning-option]
> warning: unknown warning option '-Wimplicit-fallthrough=2'; did you mean '-Wimplicit-fallthrough'? [-Wunknown-warning-option]
> 2 warnings generated.
>
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
> configure | 23 +++++++++++++++++++++++
> meson.build | 5 ++++-
> 2 files changed, 27 insertions(+), 1 deletion(-)
>
> diff --git a/configure b/configure
> index 3217aa22cb..df6eaec067 100755
> --- a/configure
> +++ b/configure
> @@ -77,6 +77,7 @@ TMPB="qemu-conf"
> TMPC="${TMPDIR1}/${TMPB}.c"
> TMPO="${TMPDIR1}/${TMPB}.o"
> TMPCXX="${TMPDIR1}/${TMPB}.cxx"
> +TMPM="${TMPDIR1}/${TMPB}.m"
> TMPE="${TMPDIR1}/${TMPB}.exe"
>
> rm -f config.log
> @@ -148,6 +149,10 @@ do_cxx() {
> do_compiler "$cxx" $CPU_CFLAGS "$@"
> }
>
> +do_objc() {
> + do_compiler "$objcc" $CPU_CFLAGS "$@"
> +}
> +
> # Append $2 to the variable named $1, with space separation
> add_to() {
> eval $1=\${$1:+\"\$$1 \"}\$2
> @@ -1616,10 +1621,27 @@ cc_has_warning_flag() {
> compile_prog "-Werror $optflag" ""
> }
>
> +objcc_has_warning_flag() {
> + cat > $TMPM <<EOF
> +int main(void) { return 0; }
> +EOF
> +
> + # Use the positive sense of the flag when testing for -Wno-wombat
> + # support (gcc will happily accept the -Wno- form of unknown
> + # warning options).
> + optflag="$(echo $1 | sed -e 's/^-Wno-/-W/')"
> + do_objc -Werror $optflag \
> + $OBJCFLAGS $EXTRA_OBJCFLAGS $CONFIGURE_OBJCFLAGS $QEMU_OBJCFLAGS \
> + -o $TMPE $TMPM $QEMU_LDFLAGS
> +}
> +
> for flag in $gcc_flags; do
> if cc_has_warning_flag $flag ; then
> QEMU_CFLAGS="$QEMU_CFLAGS $flag"
> fi
> + if objcc_has_warning_flag $flag ; then
> + QEMU_OBJCFLAGS="$QEMU_OBJCFLAGS $flag"
> + fi
> done
>
> if test "$stack_protector" != "no"; then
> @@ -3579,6 +3601,7 @@ echo "LD=$ld" >> $config_host_mak
> echo "CFLAGS_NOPIE=$CFLAGS_NOPIE" >> $config_host_mak
> echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
> echo "QEMU_CXXFLAGS=$QEMU_CXXFLAGS" >> $config_host_mak
> +echo "QEMU_OBJCFLAGS=$QEMU_OBJCFLAGS" >> $config_host_mak
> echo "GLIB_CFLAGS=$glib_cflags" >> $config_host_mak
> echo "GLIB_LIBS=$glib_libs" >> $config_host_mak
> echo "GLIB_VERSION=$(pkg-config --modversion glib-2.0)" >> $config_host_mak
> diff --git a/meson.build b/meson.build
> index 215c253683..7b78235a39 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -199,9 +199,11 @@ if get_option('fuzzing')
> endif
>
> add_global_arguments(config_host['QEMU_CFLAGS'].split(),
> - native: false, language: ['c', 'objc'])
> + native: false, language: ['c'])
> add_global_arguments(config_host['QEMU_CXXFLAGS'].split(),
> native: false, language: 'cpp')
> +add_global_arguments(config_host['QEMU_OBJCFLAGS'].split(),
> + native: false, language: ['objc'])
> add_global_link_arguments(config_host['QEMU_LDFLAGS'].split(),
> native: false, language: ['c', 'cpp', 'objc'])
>
> @@ -3306,6 +3308,7 @@ if link_args.length() > 0
> endif
> summary_info += {'QEMU_CFLAGS': config_host['QEMU_CFLAGS']}
> summary_info += {'QEMU_CXXFLAGS': config_host['QEMU_CXXFLAGS']}
> +summary_info += {'QEMU_OBJCFLAGS': config_host['QEMU_OBJCFLAGS']}
> summary_info += {'QEMU_LDFLAGS': config_host['QEMU_LDFLAGS']}
> summary_info += {'profiler': config_host.has_key('CONFIG_PROFILER')}
> summary_info += {'link-time optimization (LTO)': get_option('b_lto')}
next prev parent reply other threads:[~2022-02-18 15:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-15 17:00 [PATCH v2 0/8] buildsys: More fixes to use GCC on macOS Philippe Mathieu-Daudé via
2022-02-15 17:00 ` [PATCH v2 1/8] osdep: Avoid using Clang-specific __builtin_available() Philippe Mathieu-Daudé via
2022-02-15 17:01 ` [PATCH v2 2/8] osdep: Ignore 'unguarded-availability-new' warnings on macOS Catalina Philippe Mathieu-Daudé via
2022-02-16 2:36 ` Akihiko Odaki
2022-02-15 17:01 ` [PATCH v2 3/8] meson: Resolve the entitlement.sh script once for good Philippe Mathieu-Daudé via
2022-02-15 17:01 ` [PATCH v2 4/8] configure: Disable out-of-line atomic operations on Aarch64 Philippe Mathieu-Daudé via
2022-02-16 2:41 ` Akihiko Odaki
2022-02-16 10:19 ` Richard Henderson
2022-02-16 15:08 ` Philippe Mathieu-Daudé via
2022-02-16 16:42 ` Akihiko Odaki
2022-02-16 17:18 ` Philippe Mathieu-Daudé via
2022-02-16 17:19 ` Peter Maydell
2022-02-18 1:46 ` Richard Henderson
2022-02-18 15:36 ` Paolo Bonzini
2022-03-06 22:21 ` Philippe Mathieu-Daudé
2022-02-18 15:42 ` Paolo Bonzini
2022-02-15 17:01 ` [PATCH v2 5/8] meson: Log QEMU_CXXFLAGS content in summary Philippe Mathieu-Daudé via
2022-02-15 17:01 ` [PATCH v2 6/8] configure: Pass filtered QEMU_OBJCFLAGS to meson Philippe Mathieu-Daudé via
2022-02-18 15:44 ` Paolo Bonzini [this message]
2022-02-15 17:01 ` [PATCH v2 7/8] audio: Rename coreaudio extension to use Objective-C compiler Philippe Mathieu-Daudé via
2022-02-15 17:01 ` [PATCH v2 8/8] ui/cocoa: Constify qkeycode translation arrays Philippe Mathieu-Daudé via
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=c892e4b7-ea41-39ea-213f-0b980eef1106@redhat.com \
--to=pbonzini@redhat.com \
--cc=akihiko.odaki@gmail.com \
--cc=f4bug@amsat.org \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu_oss@crudebyte.com \
--cc=r.bolshakov@yadro.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 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).