Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7980743rwb; Wed, 23 Nov 2022 13:36:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf5L4UBbtOdOML9+jQJo+q6cJu6EoHSr//XNzm2oQNUBUNmO1Bc9iZ4AWFS+l8U/iXTX7MWd X-Received: by 2002:a05:6402:4445:b0:468:eef6:a83c with SMTP id o5-20020a056402444500b00468eef6a83cmr26891227edb.191.1669239380894; Wed, 23 Nov 2022 13:36:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669239380; cv=none; d=google.com; s=arc-20160816; b=vGjOpXDHn+YHbOCxrUHoD/yWfWP6MDJuE1w4wPVqsJsTJ/6EyjBmlUdJUMeD9n12tW WPX4MASvtzSOPTQWQPTDad2R8IxeQYcUhR93FaLP97llVf6T4OOUtKoGnsstTiQlQVGW 1Jc7aPAbmEBaIhgIXBD5nJIVhb01ku8CwWV3q55qdecQzQA81ffiOiJ1pxczy7TLoWHM JJVBOqAJOk2UBBHXNckxFHwIbJmHRedC4PHq7ib7KoOJteVCFAe38eRY/rdrb6DtvR0q mfvgy/Ro4vfxJeQ8/9vRCwYMP6S79CHdXkDqom2dTKz/ElmM1XjCKuqLIkRDx4lzH+K3 YNrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:jabber-id:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Z3EZygfeSAWS/oRsGNfsbyonnpinQO9YdgUk0SS/A0o=; b=WjmfaxULNKQD87edbiEfWRVzKmWOKFLXKScdhn3h77O8UnVsLSpZnlXx7uSgKp30Q6 U2q8flyO9yCcbvI6x3GLwMTx9/tAPgg5S+OyJqki2I9QbeTm3KtLnkQYTJyo3bI0oebx aYA0xrHsNdauvgK7WoW0e69Kd4+NRKpH7VjTG3lYVNea5TjCP8Z1ZryIVmhDGrEJOyJO 4VJPYkbdjYOON11xMwvkg62x75a9M3CkZfjBYhbJYI7Ad0Ncd/MVzwUmIIGY83La3cms qFfmFEbEB7CkvEA+DJT9SViLuk86ZLTA9RwXqwaJaEGrPolcrkc1kaUo12xpl5FvQ3US y8Vw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hw20-20020a170907a0d400b0077b6ecac099si5100580ejc.287.2022.11.23.13.35.54; Wed, 23 Nov 2022 13:36:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=fjasle.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238892AbiKWUjV (ORCPT + 88 others); Wed, 23 Nov 2022 15:39:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33830 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240245AbiKWUiO (ORCPT ); Wed, 23 Nov 2022 15:38:14 -0500 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60A1E317E2; Wed, 23 Nov 2022 12:38:05 -0800 (PST) Received: from leknes.fjasle.eu ([46.142.96.241]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MN5Nt-1ofaIS20t3-00J19c; Wed, 23 Nov 2022 21:37:25 +0100 Received: from localhost.fjasle.eu (bergen.fjasle.eu [IPv6:fdda:8718:be81:0:6f0:21ff:fe91:394]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by leknes.fjasle.eu (Postfix) with ESMTPS id C03043C0EF; Wed, 23 Nov 2022 21:37:23 +0100 (CET) Authentication-Results: leknes.fjasle.eu; dkim=none; dkim-atps=neutral Received: by localhost.fjasle.eu (Postfix, from userid 1000) id 012A31C7; Wed, 23 Nov 2022 21:37:19 +0100 (CET) Date: Wed, 23 Nov 2022 21:37:19 +0100 From: Nicolas Schier To: Masahiro Yamada Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , llvm@lists.linux.dev Subject: Re: [PATCH v2 2/5] kbuild: implement {gcc,clang}-min-version only with built-in functions Message-ID: References: <20221123151828.509565-1-masahiroy@kernel.org> <20221123151828.509565-2-masahiroy@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PpEkvchnOzhLX3fl" Content-Disposition: inline In-Reply-To: <20221123151828.509565-2-masahiroy@kernel.org> Jabber-ID: nicolas@fjasle.eu X-Operating-System: Debian GNU/Linux bookworm/sid X-Provags-ID: V03:K1:na8JOkgmRkyUHvQjG/nRKFVayFT0XtmW2jpmkJ4MzytkAMKrjAH bFyEPQjPoHJZfuROM8VIYVHGbFRcLPdiwCD/kOoJC8mQJb2Vpo4o6I8tyVyXi+00JhPzs0a RRnOfVhFouQuHJU3dOm3U+YGkwsP8YKVrWqad1za0MriHGs0564j4yJfEEPfou/waOmBjuz 1h3pnPYz2Gp8KKWi1Fkog== X-UI-Out-Filterresults: notjunk:1;V03:K0:W4207Z2qFVU=:RWzvvS9FK2+3aPke4dDHhe ts/nLPAIKuTEO1RP61E7BNJe9YIpnhEk4IrlvN+U4LdLFOAr62x3KjaU/9Q+TpEjTY2EfIoRa NhG2R1DdUYEBn6lw1o7OMjfTRzncTvomPK61/nAKQAdEt9I1cksY5rQSPt4APbQvgpVh4qnQo H33lh44pLsC+o7rvY8oiGGbDWDNhhNPlOW5ZLBcPGl4jZkAUaQf60vh/3u0jd5KOHlb1lYiAM cYJzQmBv6/m6AG0wYz+i6H6xJWdDE8B/n9vz/Zj1whSqu8btbXGluI+y3uoco40V+ZRXIbWRM vm8kZlvvRgIH8LtTh/exD7INIzWneETN2Yg6K1VDOE4LcQUR/zjPsSJ1rBcCgYaqd82o+stSt 4hAfT51tDUsB+2mG8ajhdw/cVjDOZ7ABVair4kKxJ2iZvEM4HvASgcFpYJ+kT2g0nRKdBbRRG kG8vaEfWaoyW/09447RaSF1I2+igwknMmzsbfELS2aRPkdXrnzNi8EtSvFdwp0vJaTqOFpXIQ qm1VritI8/YRFQC+IuCEXHMGgLgpvKtH/5GgacyCeleTt68tMBLuipwALoE5KmoMgG8cfLwYy 2d65fui17a89xlzsfbGse2fTLAMPDzpbJoW8HybAoeLAZHhqBpfCE2jO3ApC7mGacpelWrti9 jaeMQ1NTF6px2ZyzW5p2UE6f6DUnL3x/cFYVpmGpAVgyuv/26IjiNMHcuSJz5mTzYjMXgQZ5d t25Telvu2+8iQExsqTN0tCLX+G/HJg91W2DebSln0P8taSSLvBJOUrqcmldJU+vNBX2GRmtOj Zz9eVBp X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --PpEkvchnOzhLX3fl Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu 24 Nov 2022 00:18:25 GMT, Masahiro Yamada wrote: > Converting clang-min-version is straightforward because the versions > are always 6-digit. >=20 > gcc-min-version is somewhat tricky because the minimal GCC version > is GCC 5.2; prepend '0' to the version that is less than 10 so that > test-ge is always passed with 6-digit versions. >=20 > Signed-off-by: Masahiro Yamada > --- >=20 > Changes in v2: > - Covert gcc-min-version in a different way >=20 > scripts/Makefile.compiler | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) >=20 > diff --git a/scripts/Makefile.compiler b/scripts/Makefile.compiler > index 20d353dcabfb..cd75f81e88ef 100644 > --- a/scripts/Makefile.compiler > +++ b/scripts/Makefile.compiler > @@ -63,11 +63,15 @@ cc-disable-warning =3D $(call try-run,\ > =20 > # gcc-min-version > # Usage: cflags-$(call gcc-min-version, 70100) +=3D -foo > -gcc-min-version =3D $(shell [ $(CONFIG_GCC_VERSION)0 -ge $(1)0 ] && echo= y) > + > +# Preprend 0 to the version that is less than 10 so test-ge works. > +gcc-min-version =3D $(call test-ge, \ > + $(or $(filter 1%, $(CONFIG_GCC_VERSION)), 0$(CONFIG_GC= C_VERSION)), \ > + $(or $(filter 1%, $1), 0$(strip $1))) Hm, this silently expects a gcc version < 20, which we should expect in=20 about seven-eight years [1]. I am thinking about the possibility of=20 silent (but unlikely) breaks when someone in far future uses a gcc 20=20 against a kernel with this line. Probably we should not care about=20 that today, yet, right? Reviewed-by: Nicolas Schier [1]: https://gcc.gnu.org/develop.html#timeline > =20 > # clang-min-version > # Usage: cflags-$(call clang-min-version, 110000) +=3D -foo > -clang-min-version =3D $(shell [ $(CONFIG_CLANG_VERSION)0 -ge $(1)0 ] && = echo y) > +clang-min-version =3D $(call test-ge, $(CONFIG_CLANG_VERSION), $1) > =20 > # ld-option > # Usage: KBUILD_LDFLAGS +=3D $(call ld-option, -X, -Y) > --=20 > 2.34.1 --=20 epost|xmpp: nicolas@fjasle.eu irc://oftc.net/nsc =E2=86=B3 gpg: 18ed 52db e34f 860e e9fb c82b 7d97 0932 55a0 ce7f -- frykten for herren er opphav til kunnskap -- --PpEkvchnOzhLX3fl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEh0E3p4c3JKeBvsLGB1IKcBYmEmkFAmN+hHsACgkQB1IKcBYm EmkAThAA5+mKXEmPVZ/5RESfzp3+FMom6bTBouBT+hf2t8aQp6PYzzdFgjnq0hWw WbRBrNHqFOSkLJQkL2mo3YfZIORaaLtpOk9VSHWphc7LVQq4rmZGLznJwa4lmhDa R54r9pY16ywl660NjlJaL/rsMrTDsizYbs2Aj3fccjqa8js9aekVZ0uyuaIruaYG pvWT4VljvowG6YO97KLILsdqJklPd0+YLA/tzBJ/qGacaEzyvGN0ljGO4nLYnWuB 5xmjW/JTKjUs5JrkNNcYZP9T3QB7u/AmRVp4IcRIOAZ8K/iV+pdWG06+XFB1kmoO 80B/9sKTCUGtjgxPqmKAGgYd2tGV2vCHRUPs2LVExbYlbRiwKumDrySidSec5Wjs 5YNjryPS7MyQftL7glG3CeEUB2Xw5IGEbb21rlChS3Q4IlLsBIqlmT9UjPgqz0r+ F5jnTtnoEx/Lk6WM8a8jUKjxGIrGaiDwFeY+KWVikBPuuzx08JRlVbD/zg155du1 9F3rpiIlO1OrwWzucaiW2PYrkpUqA8I8XMVBn5d5CtRtxVeQ3aXU081bn68xyM9y FzS38YJDMrWfzj6j0wMVYCZb3F1wv97mJBoy7X2+xiq/oEUJmH0B/x/zo/yhZRbi W1Q/+L5DygbN11q/1paxAhAIXPxBbFQNWLHvT3Yg3d1dJk21ihY= =gMci -----END PGP SIGNATURE----- --PpEkvchnOzhLX3fl--