Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7986119rwb; Wed, 23 Nov 2022 13:42:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf7gH8rgIvWfpne/VBJNXVhLxcnHu3/ivVSJXOiHDH59o0uDA4AmrPlnHIpNywZDAH6nMapY X-Received: by 2002:a17:906:6153:b0:7ad:b51d:39d0 with SMTP id p19-20020a170906615300b007adb51d39d0mr24559885ejl.571.1669239744305; Wed, 23 Nov 2022 13:42:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669239744; cv=none; d=google.com; s=arc-20160816; b=03c176Bl/Y3oNE2JoU+dTYKuHP1aaScgv7pn5T/cLdDQmY5bIlNvZZOP0eXufB/dF1 ITVUpUKnjlxGaQm95dAeR90e+ERjM4GgGFkwTFrl0qME9/WmeMfyHUyTkktHvsL9v5E+ ZlzN5E6wdbSszVrfCIE6rWFe0U5yWEH9WqUKqUF7LPiQYA6snRJxL2yCvgXe2ZSU+rqe AJoVaTA4JR8mamMeMvTZcbiselvwiGcpKzoNU0+XISxRwY/c3MDbk55dttWp87uwp+Kz h1Apggi74JEQfMpql6JIMQAl3OLBpqZELOy6BdtUUkh9lO06RwKKY9sn+e/0ANvRNzaA tchw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature:dkim-filter; bh=JaNFLVtpV/R2YcJ5P3G75gE6eDlCUl66VDKvTIO+Uto=; b=BHaGqVOIjKlFNlzJbA9zeFnarPuEe77neqO0ikVrNZZHbT0Jc4x0swlWq42giGECWu coh7aVRBZCkVWTo213xgjirRxEVWlR317/NntejY06p5Z+e6BYzDwV3GvKfOICF9j/bX LldOOtO1NvxGeevBYhILcGW+M5bHy3GYOorCwWzCioBP0pc02RiZBKY/yUC76dY68D4Z 44Ky7p2ktzXknrSBUEcwknz7MhuIZEuzfbl9ETsHBu22V95kRQsm8fP2Ju+LimeH3W+Z NcSiV7TcC/M4ADrU+iArAX/Y+F5/kcxrc3elQghoE1nfc0enrvz3AyTmmaotUmn3S9ux 1+qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="Nm4BQHt/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa35-20020a17090786a300b007adadff675fsi367533ejc.313.2022.11.23.13.42.02; Wed, 23 Nov 2022 13:42:24 -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; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="Nm4BQHt/"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237496AbiKWVTI (ORCPT + 88 others); Wed, 23 Nov 2022 16:19:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237514AbiKWVTF (ORCPT ); Wed, 23 Nov 2022 16:19:05 -0500 Received: from conssluserg-04.nifty.com (conssluserg-04.nifty.com [210.131.2.83]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04E686153D; Wed, 23 Nov 2022 13:19:03 -0800 (PST) Received: from mail-oa1-f47.google.com (mail-oa1-f47.google.com [209.85.160.47]) (authenticated) by conssluserg-04.nifty.com with ESMTP id 2ANLIZtB011371; Thu, 24 Nov 2022 06:18:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-04.nifty.com 2ANLIZtB011371 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1669238316; bh=JaNFLVtpV/R2YcJ5P3G75gE6eDlCUl66VDKvTIO+Uto=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Nm4BQHt/aNubjM0c0XRsqsGCStBmXbgMiUQduWj4yG/7odqRlLtx3FB/UqvtEuuml D94xgG8JGi8Wzl9hK9CSZOAWhaPUMp2HFrfzMh7Sl9qhcSp0whk8sgwZgoSG3ixeU3 ITYjV5becHZGev8v59yUYNCnaPnt55Z+JQX8M5DON5mMIafwhXTJYQKCJ1kIOSywQ1 k0sX61l3Bd1hpRMrTi56qUxwQytnU8FfpE1FISy9kO4Hq/PgTwmW3XgKJdsZw/VCH1 Mo7KhZkDkaXJooN19rr6atSI/LvVcpjm2WWdOIibv1j/En8Qm6ikYX3WVdSR9OBpwZ ZlBLjJgmnszRg== X-Nifty-SrcIP: [209.85.160.47] Received: by mail-oa1-f47.google.com with SMTP id 586e51a60fabf-14286d5ebc3so18981557fac.3; Wed, 23 Nov 2022 13:18:36 -0800 (PST) X-Gm-Message-State: ANoB5pnCWLO5H94JWa3G3huPOtA6vc/vlkxAkfOahfzb/+/RLrYrMlLW UoqoXb90wI/tZxJJ+qu/b7y49iojrhPJrOaS5JA= X-Received: by 2002:a05:6870:ea8e:b0:13b:a31f:45fd with SMTP id s14-20020a056870ea8e00b0013ba31f45fdmr19803930oap.194.1669238315233; Wed, 23 Nov 2022 13:18:35 -0800 (PST) MIME-Version: 1.0 References: <20221123151828.509565-1-masahiroy@kernel.org> <20221123151828.509565-2-masahiroy@kernel.org> In-Reply-To: From: Masahiro Yamada Date: Thu, 24 Nov 2022 06:17:59 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 2/5] kbuild: implement {gcc,clang}-min-version only with built-in functions To: Nicolas Schier Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Tom Rix , llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_SOFTFAIL autolearn=no 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 On Thu, Nov 24, 2022 at 5:37 AM Nicolas Schier wrote: > > 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. > > > > 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. > > > > Signed-off-by: Masahiro Yamada > > --- > > > > Changes in v2: > > - Covert gcc-min-version in a different way > > > > scripts/Makefile.compiler | 8 ++++++-- > > 1 file changed, 6 insertions(+), 2 deletions(-) > > > > 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 = $(call try-run,\ > > > > # gcc-min-version > > # Usage: cflags-$(call gcc-min-version, 70100) += -foo > > -gcc-min-version = $(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 = $(call test-ge, \ > > + $(or $(filter 1%, $(CONFIG_GCC_VERSION)), 0$(CONFIG_GCC_VERSION)), \ > > + $(or $(filter 1%, $1), 0$(strip $1))) > > Hm, this silently expects a gcc version < 20, which we should expect in > about seven-eight years [1]. I am thinking about the possibility of > silent (but unlikely) breaks when someone in far future uses a gcc 20 > against a kernel with this line. Probably we should not care about > that today, yet, right? Yeah, I thought of it. It depends on which of the following two will happen first. (a) We raise the min gcc version to 10.0.0 and remove this hack (b) GCC 20 is released I am guessing (a) will occur first, so we do not need to care about (b). If (b) happens first, we will need to add "2%". It means that the window of supported GCC versions will get larger than 10. Presumably, we do not want to support such a wide range of compiler versions. GCC 5.1 was released in 2015. So, the current window of GCC versions is 7 years. I hope it will not get even larger... -- Best Regards Masahiro Yamada