Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp5714974pxv; Wed, 7 Jul 2021 10:03:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8e3HfrziEkfpYxO0cwQSFUjycrX1mI23uTUAgFUtOAq3UMqwhpQ3/ulf/jBY/Fin8fVCW X-Received: by 2002:a05:6e02:144c:: with SMTP id p12mr18571194ilo.290.1625677407410; Wed, 07 Jul 2021 10:03:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625677407; cv=none; d=google.com; s=arc-20160816; b=mw6xsUU3NlYj4MzWH1rmTcZhSzbfhXpCIQMivQreggWhQ3ybC7kUvaVQqlRHs8TgbN fMD/R1vOkptRtYXrjdd95BYZJ3GzfdQ1a4XAcCpxDiYwbpLKLufjrgyvs9FjX8yqts9q 0IIk9jmo+LDAzYVuPjCz6cveY8C420bkoeOXDi8cKpvY6bCW/7638hGnE+HJ9a6J5nHX 4ws7aE2S454RUO9WsIyEGSzOsz6z2E+nEUpUD3tcIcOPAm0tDWGJiojwuDx6Onfzhrg+ EQ9uD2KGoQo5PxgsCHC6pXx2NXsVnJHEpp7vyz6Jm9FC9vAGbe0EUcQ/xEof0yIJjsY8 q+EQ== 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=Nvt17DC+0V0vDNtkCundvZnkSWcUic46kjkyGHinAVw=; b=ihYWVJG33KOG7Qy/ERp7YCcEniAK0sftel9psioSZqjis57IrjKpEJ6PGIge12Lv+A FHajiZhaU5d5UAKBP4P+/GkHwOa7myuks4xOMj9mdU36D1cyCLIJVnjYG3l4CNRzvZ5J 5V6RbdElV+FkPCaAXMqlBKX5aS/YGmNPs71uNmLjW/Lp7gCs0a48QWMgVjAKLH9cJ/yt Uf0U864KsQebfleBMw7fvYUM1UG/qaD/9Z+6Y4YmgXtOU67QWIFp/UDPIgWODHPclbxH td8Xr9WTVQeHBXyFAbySiVmQ/+SDibCKTMfqrgxE+iSl7ELOOgRZ82IirfaIT03GnLwz E8sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Ae0a52BS; 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 s9si22203897ilq.3.2021.07.07.10.03.15; Wed, 07 Jul 2021 10:03:27 -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=Ae0a52BS; 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 S230109AbhGGRFS (ORCPT + 99 others); Wed, 7 Jul 2021 13:05:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230012AbhGGRFR (ORCPT ); Wed, 7 Jul 2021 13:05:17 -0400 Received: from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com [IPv6:2607:f8b0:4864:20::b2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 396AEC061574 for ; Wed, 7 Jul 2021 10:02:36 -0700 (PDT) Received: by mail-yb1-xb2e.google.com with SMTP id y38so4250689ybi.1 for ; Wed, 07 Jul 2021 10:02:36 -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=Nvt17DC+0V0vDNtkCundvZnkSWcUic46kjkyGHinAVw=; b=Ae0a52BSY3240NlXOn9VTQD/j3EZgVypicQrCdtTwLUvb3YFMLxg4gudqyryj9pTdZ PV8a4D9s8yKvDhS0OX/NoFMkj1weo6/rOxZACtDgo3+masXCMmxGRH2ra8x50dFulqzd OEwlw6slgyGYQ1vb/F1X/4Go6FUKxKmmBco2wehmzPVRUsdqeKBRgajb4MascRslbUPv IMMlHLE+AZktRbPkHTXQVhvnmV9fZQAuEzfPF1x3lfeANsUShYuQUhkrMNueVVm7+U1K VkL5OzO/HC1K+rUTstP/luufafCIH7p1FWOB36KFmy/GqrjU1aUO3Hf6tNwioZrY2ULZ XwVw== 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=Nvt17DC+0V0vDNtkCundvZnkSWcUic46kjkyGHinAVw=; b=sHVUdZDrZgyrQoYBGqNpwUDYNKvhmD3lHTSKW+ooau8/k+wyGQvJ1bFYxMz6fvCADG 6as4lDSXa5ZRtWZQka1idjnYagpQ7wk6QmgbxJTGYkpv2LK7cLHCzavxITz0dGp4Gofg i0jzEGG/lINCX5SVL0/FHiL6ncFG7py5yNEWuWvft5kfd36V+1NtAu5/tFf8DhdzSq0R 6ZHK2hujAIfDWKtWjrsOGlX96ziw8MaZLUEE+GP3K0qYLtKij7bfygdahXu0mU2kWOmh SYQVYesUZxOLRXEprOAIR3OPsRaDeFuxYbuXjVPWPIeGc9TQsxvOTWIZlC7ZEYBS9Zh7 /ULw== X-Gm-Message-State: AOAM5333rz94fi10BjFPZ1wfzGQZAGt2LFC+/wzGi9OWR5oIisbKdwJz mifLebcUfAWRZiV8RshTJ4nZXR2bpMeqb090snMwlA== X-Received: by 2002:a25:7085:: with SMTP id l127mr35127383ybc.293.1625677355105; Wed, 07 Jul 2021 10:02:35 -0700 (PDT) MIME-Version: 1.0 References: <20210706090607.19421-1-lecopzer.chen@mediatek.com> In-Reply-To: <20210706090607.19421-1-lecopzer.chen@mediatek.com> From: Sami Tolvanen Date: Wed, 7 Jul 2021 10:02:24 -0700 Message-ID: Subject: Re: [PATCH v3 1/2] Kbuild: lto: add CONFIG_MAKE_VERSION To: Lecopzer Chen Cc: clang-built-linux@googlegroups.com, keescook@chromium.org, linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, masahiroy@kernel.org, michal.lkml@markovi.net, nathan@kernel.org, ndesaulniers@google.com, yj.chiang@mediatek.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 6, 2021 at 2:06 AM Lecopzer Chen wrote: > > > 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? > > > > > I've tested this in both make-4.3 and 3.81, and the CRC is correct. > But I'm not sure if anyone would have the "arg list too long" issue. > > Tested-by: Lecopzer Chen Thank you for testing. This should produce a command identical to the wildcard version (with newer Make versions), so that shouldn't be an issue. If nobody objects to this approach, would you mind putting this into a proper patch and sending it as v4? Sami