From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 767D1C433FE for ; Thu, 7 Oct 2021 20:49:58 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E9C0960FDC for ; Thu, 7 Oct 2021 20:49:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E9C0960FDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:47460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mYaKy-0001A5-Vy for qemu-devel@archiver.kernel.org; Thu, 07 Oct 2021 16:49:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mYaDK-0005Mp-Da for qemu-devel@nongnu.org; Thu, 07 Oct 2021 16:42:02 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:42535) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mYaDI-00060z-9H for qemu-devel@nongnu.org; Thu, 07 Oct 2021 16:42:02 -0400 Received: by mail-wr1-x435.google.com with SMTP id v17so22853567wrv.9 for ; Thu, 07 Oct 2021 13:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3dMhmHHVf8ciOiXK8t5V+9/8kRBw/WsMdtLT3Yc85Ds=; b=Ahfrwgh61Imeg4FN+04nhyTs6r7Dd0815q6VxySEQzGt3r/fh01DP/kFZHmwwon3jN lDweluYF8TTlozHBPzeJzCAQXF4ev9JMjrLimKRtCvKryxKCdoEwElu3vHmxP/zak0ux CucxvFJ01IF8SmBnc65HF0TkPmz9bwNZbUbxVAUQup0LusLkEv5xXo1DO+0HTOji6/Y2 1lEW3hixJWhYEUtzCTtiU1RE2v0z3EqS6y6JkIzyHgpN5lFk2u9xz/ULfip2qgNXjLpX sUWER5YS82p1bfCpgYdzq6oJrMCDCPQqNXnIz2TbAEV8d6IEj5EPbjd2MZmhY7UX+3Ff ehWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3dMhmHHVf8ciOiXK8t5V+9/8kRBw/WsMdtLT3Yc85Ds=; b=isnCJqiiVj1Oh274ASCyqPR/lxz1a+GwZ6YXDxydnIrXS2/93zd+lyv1ZqrU5e2o/N nOG1Kc68Y6wxfa68SQ+Mju1BJWjZOFe8w7vas67JXdBGC6EvXhxI2ZokLEe2I/boL8w6 DSp8c3xqsPTXNjsDDpATf1f0rddu/Nw2b6XRUmOdT6n0TdAuFRNJdrBgzNF0cOgv+CW0 8qv+V3170q/F6K1L5wwyl7D9UGXMr2R9h5bvYipJqN7lFX4LIuk+M4P/Yv6Oad1XmNom wfgi2zpGqiyAakYwiafPRZ22L3MNvIWFxQZmR4VWmwelYtoSuMPaQMbsfoEMqEYtXn02 BWgQ== X-Gm-Message-State: AOAM532eS21DHqNRvtK6q+5jvvf4Ywnm7A/aXx+w9hyxHFocZ2hR9Bw6 u2QhBJMIWCDoi6pk0Hjap5A4Oh3dZHtKKI5Po/+e1PS5 X-Google-Smtp-Source: ABdhPJzu8R4rzhb9eSJ9wIZeEmRwO5K7P8r0YTbxMhLMmWIpZ4Q4YBa3Sm6H+rRpCxPtmu2FJs1yC4UjQMS/pFi6Vlo= X-Received: by 2002:adf:a78a:: with SMTP id j10mr8253379wrc.231.1633639318783; Thu, 07 Oct 2021 13:41:58 -0700 (PDT) MIME-Version: 1.0 References: <20211007130630.632028-1-pbonzini@redhat.com> <20211007130829.632254-8-pbonzini@redhat.com> In-Reply-To: <20211007130829.632254-8-pbonzini@redhat.com> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Fri, 8 Oct 2021 00:41:44 +0400 Message-ID: Subject: Re: [PATCH 13/24] configure, meson: move remaining HAVE_* compiler tests to Meson To: Paolo Bonzini Content-Type: multipart/alternative; boundary="000000000000498b9905cdc94b53" Received-SPF: pass client-ip=2a00:1450:4864:20::435; envelope-from=marcandre.lureau@gmail.com; helo=mail-wr1-x435.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: QEMU Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000498b9905cdc94b53 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Oct 7, 2021 at 5:23 PM Paolo Bonzini wrote: > Remove some special cases by moving them to Meson. > > Signed-off-by: Paolo Bonzini > Reviewed-by: Marc-Andr=C3=A9 Lureau > --- > configure | 37 ------------------------------------- > meson.build | 22 ++++++++++++++++++++-- > 2 files changed, 20 insertions(+), 39 deletions(-) > > diff --git a/configure b/configure > index 499c84859d..52f89b05d6 100755 > --- a/configure > +++ b/configure > @@ -2401,18 +2401,6 @@ else > l2tpv3=3Dno > fi > > -cat > $TMPC < -#include > -int main(int argc, char *argv[]) { > - return mlockall(MCL_FUTURE); > -} > -EOF > -if compile_prog "" "" ; then > - have_mlockall=3Dyes > -else > - have_mlockall=3Dno > -fi > - > ######################################### > # vhost interdependencies and host support > > @@ -3840,21 +3828,6 @@ if test "$fortify_source" !=3D "no"; then > fi > fi > > -########################################## > -# check if struct fsxattr is available via linux/fs.h > - > -have_fsxattr=3Dno > -cat > $TMPC << EOF > -#include > -struct fsxattr foo; > -int main(void) { > - return 0; > -} > -EOF > -if compile_prog "" "" ; then > - have_fsxattr=3Dyes > -fi > - > ########################################## > # check for usable membarrier system call > if test "$membarrier" =3D "yes"; then > @@ -4356,13 +4329,6 @@ if test "$gdbus_codegen" !=3D "" ; then > fi > echo "CONFIG_TLS_PRIORITY=3D\"$tls_priority\"" >> $config_host_mak > > -# Work around a system header bug with some kernel/XFS header > -# versions where they both try to define 'struct fsxattr': > -# xfs headers will not try to redefine structs from linux headers > -# if this macro is set. > -if test "$have_fsxattr" =3D "yes" ; then > - echo "HAVE_FSXATTR=3Dy" >> $config_host_mak > -fi > if test "$xen" =3D "enabled" ; then > echo "CONFIG_XEN_BACKEND=3Dy" >> $config_host_mak > echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=3D$xen_ctrl_version" >> > $config_host_mak > @@ -4567,9 +4533,6 @@ fi > if test "$parallels" =3D "yes" ; then > echo "CONFIG_PARALLELS=3Dy" >> $config_host_mak > fi > -if test "$have_mlockall" =3D "yes" ; then > - echo "HAVE_MLOCKALL=3Dy" >> $config_host_mak > -fi > > if test "$plugins" =3D "yes" ; then > echo "CONFIG_PLUGIN=3Dy" >> $config_host_mak > diff --git a/meson.build b/meson.build > index 2962c24eb5..935a20c198 100644 > --- a/meson.build > +++ b/meson.build > @@ -1604,6 +1604,23 @@ config_host_data.set('CONFIG_SPLICE', > cc.links(gnu_source_prefix + ''' > return 0; > }''')) > > +config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix + ''' > + #include > + int main(int argc, char *argv[]) { > + return mlockall(MCL_FUTURE); > + }''')) > + > +# Work around a system header bug with some kernel/XFS header > +# versions where they both try to define 'struct fsxattr': > +# xfs headers will not try to redefine structs from linux headers > +# if this macro is set. > +config_host_data.set('HAVE_FSXATTR', cc.links(''' > + #include ' > + struct fsxattr foo; > + int main(void) { > + return 0; > + }''')) > + > # Some versions of Mac OS X incorrectly define SIZE_MAX > config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(''' > #include > @@ -1612,7 +1629,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', not > cc.compiles(''' > return printf("%zu", SIZE_MAX); > }''', args: ['-Werror'])) > > -ignored =3D ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target > +ignored =3D ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target > + 'HAVE_GDB_BIN'] > arrays =3D ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_WHITELIST'] > strings =3D ['CONFIG_IASL'] > foreach k, v: config_host > @@ -1627,7 +1645,7 @@ foreach k, v: config_host > config_host_data.set('HOST_' + v.to_upper(), 1) > elif strings.contains(k) > config_host_data.set_quoted(k, v) > - elif k.startswith('CONFIG_') or k.startswith('HAVE_') > + elif k.startswith('CONFIG_') > config_host_data.set(k, v =3D=3D 'y' ? 1 : v) > endif > endforeach > -- > 2.31.1 > > > > --=20 Marc-Andr=C3=A9 Lureau --000000000000498b9905cdc94b53 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Thu, Oct 7, 2021 at 5:23 PM Paolo = Bonzini <pbonzi= ni@redhat.com> wrote:
Remove some special cases by moving them to Meson.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

<= div>
Reviewed-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com><= /div>=C2=A0
---
=C2=A0configure=C2=A0 =C2=A0| 37 -------------------------------------
=C2=A0meson.build | 22 ++++++++++++++++++++--
=C2=A02 files changed, 20 insertions(+), 39 deletions(-)

diff --git a/configure b/configure
index 499c84859d..52f89b05d6 100755
--- a/configure
+++ b/configure
@@ -2401,18 +2401,6 @@ else
=C2=A0 =C2=A0l2tpv3=3Dno
=C2=A0fi

-cat > $TMPC <<EOF
-#include <sys/mman.h>
-int main(int argc, char *argv[]) {
-=C2=A0 =C2=A0 return mlockall(MCL_FUTURE);
-}
-EOF
-if compile_prog "" "" ; then
-=C2=A0 have_mlockall=3Dyes
-else
-=C2=A0 have_mlockall=3Dno
-fi
-
=C2=A0#########################################
=C2=A0# vhost interdependencies and host support

@@ -3840,21 +3828,6 @@ if test "$fortify_source" !=3D "no&qu= ot;; then
=C2=A0 =C2=A0fi
=C2=A0fi

-##########################################
-# check if struct fsxattr is available via linux/fs.h
-
-have_fsxattr=3Dno
-cat > $TMPC << EOF
-#include <linux/fs.h>
-struct fsxattr foo;
-int main(void) {
-=C2=A0 return 0;
-}
-EOF
-if compile_prog "" "" ; then
-=C2=A0 =C2=A0 have_fsxattr=3Dyes
-fi
-
=C2=A0##########################################
=C2=A0# check for usable membarrier system call
=C2=A0if test "$membarrier" =3D "yes"; then
@@ -4356,13 +4329,6 @@ if test "$gdbus_codegen" !=3D ""= ; then
=C2=A0fi
=C2=A0echo "CONFIG_TLS_PRIORITY=3D\"$tls_priority\"" &g= t;> $config_host_mak

-# Work around a system header bug with some kernel/XFS header
-# versions where they both try to define 'struct fsxattr':
-# xfs headers will not try to redefine structs from linux headers
-# if this macro is set.
-if test "$have_fsxattr" =3D "yes" ; then
-=C2=A0 =C2=A0 echo "HAVE_FSXATTR=3Dy" >> $config_host_mak<= br> -fi
=C2=A0if test "$xen" =3D "enabled" ; then
=C2=A0 =C2=A0echo "CONFIG_XEN_BACKEND=3Dy" >> $config_host_= mak
=C2=A0 =C2=A0echo "CONFIG_XEN_CTRL_INTERFACE_VERSION=3D$xen_ctrl_versi= on" >> $config_host_mak
@@ -4567,9 +4533,6 @@ fi
=C2=A0if test "$parallels" =3D "yes" ; then
=C2=A0 =C2=A0echo "CONFIG_PARALLELS=3Dy" >> $config_host_ma= k
=C2=A0fi
-if test "$have_mlockall" =3D "yes" ; then
-=C2=A0 echo "HAVE_MLOCKALL=3Dy" >> $config_host_mak
-fi

=C2=A0if test "$plugins" =3D "yes" ; then
=C2=A0 =C2=A0 =C2=A0echo "CONFIG_PLUGIN=3Dy" >> $config_hos= t_mak
diff --git a/meson.build b/meson.build
index 2962c24eb5..935a20c198 100644
--- a/meson.build
+++ b/meson.build
@@ -1604,6 +1604,23 @@ config_host_data.set('CONFIG_SPLICE', cc.lin= ks(gnu_source_prefix + '''
=C2=A0 =C2=A0 =C2=A0return 0;
=C2=A0 =C2=A0}'''))

+config_host_data.set('HAVE_MLOCKALL', cc.links(gnu_source_prefix += '''
+=C2=A0 #include <sys/mman.h>
+=C2=A0 int main(int argc, char *argv[]) {
+=C2=A0 =C2=A0 return mlockall(MCL_FUTURE);
+=C2=A0 }'''))
+
+# Work around a system header bug with some kernel/XFS header
+# versions where they both try to define 'struct fsxattr':
+# xfs headers will not try to redefine structs from linux headers
+# if this macro is set.
+config_host_data.set('HAVE_FSXATTR', cc.links('''
+=C2=A0 #include <linux/fs.h>'
+=C2=A0 struct fsxattr foo;
+=C2=A0 int main(void) {
+=C2=A0 =C2=A0 return 0;
+=C2=A0 }'''))
+
=C2=A0# Some versions of Mac OS X incorrectly define SIZE_MAX
=C2=A0config_host_data.set('HAVE_BROKEN_SIZE_MAX', not cc.compiles(= '''
=C2=A0 =C2=A0 =C2=A0#include <stdint.h>
@@ -1612,7 +1629,8 @@ config_host_data.set('HAVE_BROKEN_SIZE_MAX', = not cc.compiles('''
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0return printf("%zu", SIZE_MAX);=
=C2=A0 =C2=A0 =C2=A0}''', args: ['-Werror']))

-ignored =3D ['CONFIG_QEMU_INTERP_PREFIX'] # actually per-target +ignored =3D ['CONFIG_QEMU_INTERP_PREFIX', # actually per-target +=C2=A0 =C2=A0 'HAVE_GDB_BIN']
=C2=A0arrays =3D ['CONFIG_BDRV_RW_WHITELIST', 'CONFIG_BDRV_RO_W= HITELIST']
=C2=A0strings =3D ['CONFIG_IASL']
=C2=A0foreach k, v: config_host
@@ -1627,7 +1645,7 @@ foreach k, v: config_host
=C2=A0 =C2=A0 =C2=A0config_host_data.set('HOST_' + v.to_upper(), 1)=
=C2=A0 =C2=A0elif strings.contains(k)
=C2=A0 =C2=A0 =C2=A0config_host_data.set_quoted(k, v)
-=C2=A0 elif k.startswith('CONFIG_') or k.startswith('HAVE_'= ;)
+=C2=A0 elif k.startswith('CONFIG_')
=C2=A0 =C2=A0 =C2=A0config_host_data.set(k, v =3D=3D 'y' ? 1 : v) =C2=A0 =C2=A0endif
=C2=A0endforeach
--
2.31.1





--
Marc-Andr= =C3=A9 Lureau
--000000000000498b9905cdc94b53--