Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4004918pxv; Mon, 5 Jul 2021 11:04:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwbkwslTBiAcx6K7bvCGPBTW9BUZXFFOdOnk5Roo8F/GSwMq3Bb+bngfzPcAg5NFdYhZbO5 X-Received: by 2002:a17:906:c1d2:: with SMTP id bw18mr14157147ejb.123.1625508253958; Mon, 05 Jul 2021 11:04:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625508253; cv=none; d=google.com; s=arc-20160816; b=N+w/+5KsypY8T7tzUjR//K/JqQk1cCWuoK/3ChAJoR8q/mSZjUZ1OPNTvUdQYNgoFy K6WVf/e8OoiCviz4c9asoAMBbyZ8wzIjq/epZHeGtGsS/bq+yMxv5/+uHU8t3thbvYc7 lwX86eFJHiNHmMv+YhXXB8Kk8YjeuP4WPTQuwk8YRA6dDDt5unnQATFQBxKx0lRNAtL3 KGGTjKZCqFx608ectTaEPVp9q9V+bzSHUdQj2CsB7dk4qmT17HNsz30kA/OFDcG7DelD QIdqM9+jphkXE79be8L0tlXyJazocvN0J1mNmNFH4jQxN0Uo5njErP4FizSi+QZgdoNP jLhg== 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; bh=gJsboDNld2P6AbWlug6aDXd7eLnwEy72n526BJjJ3p4=; b=drd/Jmc4vNaL34JP7v3ExXcfjQCsXefwDkeSSxqriaq6Fn7ApHgRyQdCwhNTeJ2Sb2 XT/eFhIn1534Mq8trXda0iCQh9qQdn1oEwEl+J1eeXUAEtYQk6T8em4Tnnk1xk/aelG/ 4SLFosSFbUB3BAl03I58jKh17rCAIRwzHd60EOLNEjBca4G7bwNXobS26nmbUxhUEArw w57dXTNEOd3uTcXmZdjS4Bewd4bJUc+K00vrf4wQ8CC+VnO6GljJQwZ+ObBG3xZb1KCj kB4oB3JW3/XSI/it2Q7QJboJm9CijiYPZOhsmU3rKSI9s/M2FufU9BFmRbuP0VO2wJaG qvhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EXqSe5LB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s8si11427522ejm.214.2021.07.05.11.03.50; Mon, 05 Jul 2021 11:04:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=EXqSe5LB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbhGESC3 (ORCPT + 99 others); Mon, 5 Jul 2021 14:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229879AbhGESC2 (ORCPT ); Mon, 5 Jul 2021 14:02:28 -0400 Received: from mail-yb1-xb32.google.com (mail-yb1-xb32.google.com [IPv6:2607:f8b0:4864:20::b32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4741BC061760 for ; Mon, 5 Jul 2021 10:59:51 -0700 (PDT) Received: by mail-yb1-xb32.google.com with SMTP id s129so30318224ybf.3 for ; Mon, 05 Jul 2021 10:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gJsboDNld2P6AbWlug6aDXd7eLnwEy72n526BJjJ3p4=; b=EXqSe5LBsLsLCtQiC8U/5Swb48WLpeSqS53eK2HIJRAVgtZeLSLS8A1wZ6eHgnCvc7 yYyGiLzAg5kHHmj95ZJwzrQ8+jiI4dQIXuPBYD7eArDwyslmw/KUjaqixVz80HIs95cr opGbcBdxR62OF1sDMSjE7x1ZLMoRMQmzc5qtxYCbwHFwtgMrkbYWcghfWg40xwCrlesM l5YSUUfyLiwe1VQhV0mf7mEohw9ZYV21sksVI7UpkbYqM2FiLK+3tG2Pw1EIEEqlsF1Q IijD4D61dFjQycgonxf9i5m6dzoYTs+ATalj6Gb5PIhriSMhzPu03lgiYC8BLJMqiJJX EuVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gJsboDNld2P6AbWlug6aDXd7eLnwEy72n526BJjJ3p4=; b=ikdx8lLwniRpwVYP1tJ7cT2RbZlt0cHXFNpwO9M+biaYxi7JtGleAR3a3x84oa2qO6 E4MwRFYRy4dNPl3ENIWncIt51/jspIJBaHNBJ2KOuQVepLiNE9CwSO/AxznaEgPskfpr lgLm/5O3V1jnPyolpkvlWKMooiwDG41g7WfEoSwxEMfbtcOL5GsgnVsPECGNcJOJuPiS +xz2vi+X3EBZy0UiVHtrL7ZY21sP8JnwBZPAhuonKyq5Q4ma7j7VQ7UY8jttt276+fSI Qdq3CD4cxdXBeYv3wIlTHr2iMUzhnW1jr/QPottwY7VAFPYmSCDoy8g8BrNPADYyqRZi RHug== X-Gm-Message-State: AOAM531b21JjmSy1Yhe/PcOICm4K94gTu/ZsxNeetpcX6fvtmoSfpxW5 GkpbwcQdZMXOG2yKvq6+jk8RVHEcuayWbR+2TPsdZQ== X-Received: by 2002:a25:7b86:: with SMTP id w128mr20063583ybc.273.1625507990140; Mon, 05 Jul 2021 10:59:50 -0700 (PDT) MIME-Version: 1.0 References: <20210702032943.7865-1-lecopzer.chen@mediatek.com> <20210702032943.7865-2-lecopzer.chen@mediatek.com> In-Reply-To: From: Sami Tolvanen Date: Mon, 5 Jul 2021 10:59:39 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] Kbuild: lto: add CONFIG_MAKE_VERSION To: Masahiro Yamada Cc: Lecopzer Chen , Nick Desaulniers , Kees Cook , Linux Kbuild mailing list , Nathan Chancellor , clang-built-linux , Linux Kernel Mailing List , yj.chiang@mediatek.com, Michal Marek Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jul 4, 2021 at 7:03 PM Masahiro Yamada wrote: > > On Fri, Jul 2, 2021 at 12:29 PM Lecopzer Chen > wrote: > > > > To check the GNU make version. Used by the LTO Kconfig. > > > > LTO with MODVERSIONS will fail in generating correct CRC because > > the makefile rule doesn't work for make with version 3.8X.[1] > > > > Thus we need to check make version during selecting on LTO Kconfig. > > Add CONFIG_MAKE_VERSION which means MAKE_VERSION in canonical digits > > for arithmetic comparisons. > > > > [1] https://lore.kernel.org/lkml/20210616080252.32046-1-lecopzer.chen@mediatek.com/ > > Signed-off-by: Lecopzer Chen > > --- > > > NACK. > > "Let's add MAKE_VERSION >= 40200 restriction > just because I cannot write correct code that > works for older Make" is a horrible idea. > > Also, Kconfig is supposed to check the compiler > (or toolchains) capability, not host tool versions. I feel like requiring a Make that's half a decade old for a feature that also requires a toolchain released last October ago isn't entirely unreasonable. That being said, if Masahiro prefers not to rely on the wildcard function's behavior here, which is a reasonable request, we could simply use the shell to test for the file's existence: diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 34d257653fb4..c6bd62f518ff 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -388,7 +388,7 @@ ifeq ($(CONFIG_LTO_CLANG) $(CONFIG_MODVERSIONS),y y) cmd_update_lto_symversions = \ rm -f $@.symversions \ $(foreach n, $(filter-out FORCE,$^), \ - $(if $(wildcard $(n).symversions), \ + $(if $(shell test -s $(n).symversions && echo y), \ ; cat $(n).symversions >> $@.symversions)) else cmd_update_lto_symversions = echo >/dev/null This is not quite as efficient as using wildcard, but should work with older Make versions too. Thoughts? Sami