From nobody Fri Dec 19 20:14:38 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1670586037; cv=none; d=zohomail.com; s=zohoarc; b=aSA3eq5EklAsn6r1k/0zUJt6iYJsb9l1GNb1zTVekSKq/j6NzJrDz9JlMlB5kGjz045z07INf7vZgOjuOUt98DTvx2XiZuTw8p20f6LWc+9m38GVhEKhqzUuoBTpAvhYcXkQJecoeK1mVslJ/Gs+nrahDmyWf6VwujLiMAgG/1o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1670586037; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=XL3SE4D+sFTguF12ERUOqOKoyGEmbAcXchpRDTm09AA=; b=cpB8nStaF5EyNDswL1qgbAHS3nZBEvTuFnD7IGIOTENYUxMclYclw5fmrXYZC2cPm6zEM3FpX9OfnEN9K60PkXTFkR+uTgiMdmVNHrRUNfq0AQYTDxdGTrgSA8wgn6ixQfPATsa/6+n8GOr0DgvsIskN8cs3gLO4D9039CDr7H4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1670586037442877.6211809258375; Fri, 9 Dec 2022 03:40:37 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3bXF-0005wX-Cz; Fri, 09 Dec 2022 06:27:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3bVq-0004Sn-9s for qemu-devel@nongnu.org; Fri, 09 Dec 2022 06:25:57 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3bVl-0001aE-RI for qemu-devel@nongnu.org; Fri, 09 Dec 2022 06:25:52 -0500 Received: from mail-ej1-f70.google.com (mail-ej1-f70.google.com [209.85.218.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-456-nDCjX1qjMXCyXQ6P3XYEvw-1; Fri, 09 Dec 2022 06:25:45 -0500 Received: by mail-ej1-f70.google.com with SMTP id hd17-20020a170907969100b007c117851c81so2942875ejc.10 for ; Fri, 09 Dec 2022 03:25:44 -0800 (PST) Received: from avogadro.local ([2001:b07:6468:f312:1c09:f536:3de6:228c]) by smtp.gmail.com with ESMTPSA id y15-20020a056402170f00b0045726e8a22bsm513811edu.46.2022.12.09.03.25.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 03:25:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1670585146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=XL3SE4D+sFTguF12ERUOqOKoyGEmbAcXchpRDTm09AA=; b=YfajYAGymRKajT//1OwwWnIOjFRR4qKXddFbC7tMJ2qfncrUJH/pGIAov2Y/D+uBwnmSGT +WqE8rHHjzM7dJaAA6zfwLmREYmpiy0cjoLzl7aps78CoXCxSPNVwSm0EeH7u7hNCkEpws kpAAHVJG1NxTzRUkme589Mth4pzZqxQ= X-MC-Unique: nDCjX1qjMXCyXQ6P3XYEvw-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XL3SE4D+sFTguF12ERUOqOKoyGEmbAcXchpRDTm09AA=; b=3VzZPHLGBxnPXZrznN49Wj+dzukN3QsMb0Hv1NcCld8sBfQmKaLuJLxIV/2fL7rwmT B8SIjL5WOmhgA9VfOic9vIEpxZg/YvPV6UUSJnROOxh+u0jrBFMYC4pnFYDsOFBWr1Hj 00I4CyBCt7uc46MPM2ZmFtz4ALNPLkBPGeW7gLgD0cKifp+qCHfvpGtwAq8dIlpuqx3S nZdseSFRv3CxWmnt+HJlP8L2MJkaXmhncoTZoEL2sRbV+MtcFChpjfXBnMp+kuDxVI6V 9awkcwImjhYsba5L7YoWzo7KDACTh5bWK8Yr4HXqtU9L3DMwdgE1fu77jr7gBKULOHS7 IFjA== X-Gm-Message-State: ANoB5pngGGUfxa4iGWEAmPA1aLt7F4s5nkBXzglM6gboeoRc5Q3HUePm lJ9Rhq2bnFskg2TfSnZgaNcjVZpb+Ixk2RYVPqkomG2B/mBdns65BH57JBDTs0w3AK/pAY27QeF XOS6ZicQwAZvg6KWP/MDIkQXy4m0/nvixibO49xRc4i+OpO0KVx2wnXzrlIT8MiZHgUA= X-Received: by 2002:a05:6402:4029:b0:462:555e:1e95 with SMTP id d41-20020a056402402900b00462555e1e95mr5262439eda.35.1670585143766; Fri, 09 Dec 2022 03:25:43 -0800 (PST) X-Google-Smtp-Source: AA0mqf4JnnnYDIS7YHQgIjSTdvVc7501fIn8nvhmG2fAv1TB8+SNB8aZXI3ccvaux9x4loieDOM5cA== X-Received: by 2002:a05:6402:4029:b0:462:555e:1e95 with SMTP id d41-20020a056402402900b00462555e1e95mr5262416eda.35.1670585143464; Fri, 09 Dec 2022 03:25:43 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 27/30] build: move compiler version check to meson Date: Fri, 9 Dec 2022 12:24:06 +0100 Message-Id: <20221209112409.184703-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221209112409.184703-1-pbonzini@redhat.com> References: <20221209112409.184703-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1670586037741100001 Content-Type: text/plain; charset="utf-8" Instead of checking with preprocessor defines, use the Meson compiler objec= t. Because of the mess Apple does with its versioning scheme, check for an option that was added in clang 6.0 instead of looking at the version number. Signed-off-by: Paolo Bonzini --- configure | 25 ------------------------- meson.build | 11 +++++++++++ 2 files changed, 11 insertions(+), 25 deletions(-) diff --git a/configure b/configure index d5491fc3b986..a7c95535fd01 100755 --- a/configure +++ b/configure @@ -1033,31 +1033,6 @@ if test "$targetos" =3D "bogus"; then error_exit "Unrecognized host OS (uname -s reports '$(uname -s)')" fi =20 -# Check whether the compiler matches our minimum requirements: -cat > $TMPC << EOF -#if defined(__clang_major__) && defined(__clang_minor__) -# ifdef __apple_build_version__ -# if __clang_major__ < 10 || (__clang_major__ =3D=3D 10 && __clang_minor_= _ < 0) -# error You need at least XCode Clang v10.0 to compile QEMU -# endif -# else -# if __clang_major__ < 6 || (__clang_major__ =3D=3D 6 && __clang_minor__ = < 0) -# error You need at least Clang v6.0 to compile QEMU -# endif -# endif -#elif defined(__GNUC__) && defined(__GNUC_MINOR__) -# if __GNUC__ < 7 || (__GNUC__ =3D=3D 7 && __GNUC_MINOR__ < 4) -# error You need at least GCC v7.4.0 to compile QEMU -# endif -#else -# error You either need GCC or Clang to compiler QEMU -#endif -int main (void) { return 0; } -EOF -if ! compile_prog "" "" ; then - error_exit "You need at least GCC v7.4 or Clang v6.0 (or XCode Clang v= 10.0)" -fi - # Resolve default for --enable-plugins if test "$static" =3D "yes" ; then if test "$plugins" =3D "yes"; then diff --git a/meson.build b/meson.build index 01c6ac0045bc..3316ff005cfc 100644 --- a/meson.build +++ b/meson.build @@ -190,6 +190,17 @@ endif # Compiler flags # ################## =20 +foreach lang : all_languages + compiler =3D meson.get_compiler(lang) + if compiler.get_id() =3D=3D 'gcc' and compiler.version().version_compare= ('>=3D7.4') + # ok + elif compiler.get_id() =3D=3D 'clang' and compiler.has_argument('-Wpragm= a-pack') + # ok + else + error('You either need GCC v7.4 or Clang v6.0 (or XCode Clang v10.0) t= o compile QEMU') + endif +endforeach + # default flags for all hosts # We use -fwrapv to tell the compiler that we require a C dialect where # left shift of signed integers is well defined and has the expected --=20 2.38.1