From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2A97C433E9 for ; Wed, 24 Feb 2021 17:18:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 806F864F0D for ; Wed, 24 Feb 2021 17:18:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235369AbhBXRS0 (ORCPT ); Wed, 24 Feb 2021 12:18:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:50384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234736AbhBXRSX (ORCPT ); Wed, 24 Feb 2021 12:18:23 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8E7E664F0B; Wed, 24 Feb 2021 17:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614187061; bh=u8ZNuqYInVQANFsOD5T+PXy7b7+EOuQxFZ7y03PJ+gw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DPpJPlXn5B7lZRP7yQOHgAs3XfYC7RiXpIbnaySmOlYIIIKeMMBBrsVCSlZLIo/GN zKRiqVGnlGlQN8lo2mhYsN1rxU3VDh/bG0Za0x06bXMhwjPGBJvOQBcjz7vkG/PEsD IVIQP2jhjzBMH0ALPTXguGEBMfGBal/Kxey6XQOMeVLHtlgSti/gPT9xpdwJWKz+aw D5hdb7P84eDsAsLS+MxZqDilZbmo8743PV8dnO/T/qn5hjqdKSjtpPvUSDZMTiL3xh 9LxWL8GFqibOP53lK6puYLabd4pFuV6gfw6lWY0fSEnLTHKqNz0+y8AX1oaDbGDryS GJevlVIOBdulg== Date: Wed, 24 Feb 2021 10:17:40 -0700 From: Nathan Chancellor To: Masahiro Yamada Cc: Sedat Dilek , Nick Desaulniers , Michal Marek , Linux Kbuild mailing list , Linux Kernel Mailing List , clang-built-linux Subject: Re: [PATCH] Makefile: reuse CC_VERSION_TEXT Message-ID: <20210224171740.GA7180@24bbad8f3778> References: <20210205220125.2931504-1-ndesaulniers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 24, 2021 at 12:14:04PM +0900, Masahiro Yamada wrote: > On Sat, Feb 6, 2021 at 12:46 PM Sedat Dilek wrote: > > > > On Sat, Feb 6, 2021 at 2:49 AM Masahiro Yamada wrote: > > > > > > On Sat, Feb 6, 2021 at 7:01 AM 'Nick Desaulniers' via Clang Built > > > Linux wrote: > > > > > > > > I noticed we're invoking $(CC) via $(shell) more than once to check the > > > > version. Let's reuse the first string captured in $CC_VERSION_TEXT. > > > > > > > > Fixes: 315bab4e972d ("kbuild: fix endless syncconfig in case arch Makefile sets CROSS_COMPILE") > > > > > > > > > I did not touch this hunk because I have a plan > > > for different refactoring, but I have never got > > > around to do it. > > > > > > Anyway, you beat me, and I will pick this up. > > > But, the Fixes tag is questionable because > > > this is code refactoring. > > > > > > > When I see this... and hear refactoring... As a suggestion/improvement... > > > > Can we have LD_VERSION_TEXT analogue to CC_VERSION_TEXT? > > Both are shown when doing a `cat /proc/version` (and IIRC in file > > include/generated/compile.h). > > Sorry, I had forgotten to answer this question. > > Probably, we should do so. > > Feeding it to Kconfig allows us to re-evaluate > config settings when tools are upgraded. > > One question is where we should draw a line. > If we record the version text of CC, LD, > we should do that for more tools? > > For LD, I will be probably OK because > some features rely on LD_VERSION or $(ld-option ). > > > -- > Best Regards > Masahiro Yamada It probably makes sense to do this for tools that we depend on in Kconfig, like CC and LD. Those will usually paint a good enough picture for what tools were used on a whole since CC will tell us about the GCC or LLVM version used (as well as distribution usually) and LD will tell us about the binutils or LLVM version. LTO does check $(AR) and $(NM) but it also depends on LLVM=1 LLVM_IAS=1, which would get covered by the $(CC) and $(LD) print outs. Cheers, Nathan