Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1945935ybb; Thu, 2 Apr 2020 10:11:02 -0700 (PDT) X-Google-Smtp-Source: APiQypJbrvmN9pF/h4a1ct98vH5V7Nu4dBmnjtzj5tp3ZU1e0+IC5x70aclIaNSaZj9yHm5F2f5B X-Received: by 2002:a9d:3b8b:: with SMTP id k11mr3072260otc.245.1585847461512; Thu, 02 Apr 2020 10:11:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585847461; cv=none; d=google.com; s=arc-20160816; b=vRidR3JFGPXNoW/Zhh6JRpqSY+YQvb8H2PZR+h6ec+rxBEu9H4ugHYXtdheWcMlQ9q vPmEJd67QztQQPNRCuzHgfh19V5T1SZHde9lGNlTgeUMTMjYWpLILFWX/MD5/eEgTWTj egJEKmg4FbWwYWhZbWJ+NennTzLhvya/IcUVUtw5Vd+j2qubc7xA0dXb+xfFEJcW+3yI nSiNRu//780CA3RHEaX1Kp2L1a1nG3AlwFlQlikdAe3lA2mCxZBkwr6KbIG7N8HH5mlr NplnaIWq6RZSznhgWhNj6Pp8pGy3upxSlR8ZtHqs1Lt5l51mTPJL7Ybb34gR2zte32KC s7Dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=1mH4cw2yYcVZRUVlvx7GMUbn2oki49fXdwmWN7fbBsc=; b=xqJMMrUH3/LGoVlCkChqTCaXhPDmRDlYAKo2FjJv8+6ojenDaO++Zr+bZ+uIipFraA rwBVPJ/YSYeHG29gzHTKiqYXmfUxbLM711lnmXn62tmGuWl2XDPZKpHM4wFyKwutFEqW fAo4wtbskG4bhXMut0Mm/T2YFpCC6oLPBFZaUxNbx9yxSIq9emLqSmPs7kHwDVLqkXzz A2YIeaLivmTq+nwl4X+2oyLhK5V6FtPCZ9nmHMcz5shg4/uSqk6Zjvt+MttUKtp1yuCp KpyCFrVmLEpIra41knXhnp8PQ4ImylnfJPZy5h85cG5c+j4uP2YRpT5qLswQqF0PYkIi /4Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rrl7k6aV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d13si2295497oij.140.2020.04.02.10.10.47; Thu, 02 Apr 2020 10:11:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rrl7k6aV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389981AbgDBRBg (ORCPT + 99 others); Thu, 2 Apr 2020 13:01:36 -0400 Received: from conssluserg-06.nifty.com ([210.131.2.91]:58726 "EHLO conssluserg-06.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732625AbgDBRBg (ORCPT ); Thu, 2 Apr 2020 13:01:36 -0400 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (authenticated) by conssluserg-06.nifty.com with ESMTP id 032H1TeJ031701; Fri, 3 Apr 2020 02:01:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-06.nifty.com 032H1TeJ031701 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1585846890; bh=1mH4cw2yYcVZRUVlvx7GMUbn2oki49fXdwmWN7fbBsc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rrl7k6aVw3iI8Z3PirOB6ZMA0fHnC57gsk0b2BLP+Lo8ry3278PY9LFojc2cEijdL favhYLtVbKdt3pgy/ChzgY6/ofWR40HQnneX85xefvGjWsCLYAxgq+39OQpEHFaC/l osspRAMc38pFIYbjtbXkvqzP2lr+6hu0Tc4yvc6kiO7KYNKCUzPTmAooT9911O1p1R xxS/OHhG/OfVkPg6DcHufavsku3e/YJqEiT6VvWW7DB2MtCxpdhWeQknl4vbIrgZaZ qVQxeKG7phAMWvOZOKmoJdcX3ytam+G2EEg/QFo5BZbMa2TimyVgqfI0nqQlsZPRbE BEqO3N1Jlqnug== X-Nifty-SrcIP: [209.85.217.54] Received: by mail-vs1-f54.google.com with SMTP id u9so2851516vsp.6; Thu, 02 Apr 2020 10:01:30 -0700 (PDT) X-Gm-Message-State: AGi0PubkUT6/Rcj4r7NU48cdqp0DT3rdsIwb51hFRHnG+jZ2+jDYFrU1 9SntwlBlmdZ+CznIOAX2ZUzEsVETYrexcnN4D08= X-Received: by 2002:a67:33cb:: with SMTP id z194mr3175293vsz.155.1585846888868; Thu, 02 Apr 2020 10:01:28 -0700 (PDT) MIME-Version: 1.0 References: <202004020117.6E434C035@keescook> In-Reply-To: <202004020117.6E434C035@keescook> From: Masahiro Yamada Date: Fri, 3 Apr 2020 02:00:52 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version To: Kees Cook Cc: Michal Marek , Thomas Gleixner , Linux Kbuild mailing list , clang-built-linux , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kees, On Thu, Apr 2, 2020 at 5:18 PM Kees Cook wrote: > > When doing Clang builds of the kernel, it is possible to link with > either ld.bfd (binutils) or ld.lld (LLVM), but it is not possible to > discover this from a running kernel. Add the "$LD -v" output to > /proc/version. > > Signed-off-by: Kees Cook > --- > init/Makefile | 2 +- > scripts/mkcompile_h | 8 ++++++-- > 2 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/init/Makefile b/init/Makefile > index 6246a06364d0..82c15bdb42d7 100644 > --- a/init/Makefile > +++ b/init/Makefile > @@ -35,4 +35,4 @@ include/generated/compile.h: FORCE > @$($(quiet)chk_compile.h) > $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ > "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \ > - "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" > + "$(CONFIG_PREEMPT_RT)" "$(LD)" "$(CC) $(KBUILD_CFLAGS)" > diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h > index 3a5a4b210c86..f98c07709370 100755 > --- a/scripts/mkcompile_h > +++ b/scripts/mkcompile_h > @@ -6,7 +6,8 @@ ARCH=$2 > SMP=$3 > PREEMPT=$4 > PREEMPT_RT=$5 > -CC=$6 > +LD=$6 > +CC=$7 Just a nit. If you just append 'LD', you do not need to touch the 'CC=$6' line. If you do not mind, I will fold the following on top of your patch. --- a/init/Makefile +++ b/init/Makefile @@ -35,4 +35,4 @@ include/generated/compile.h: FORCE @$($(quiet)chk_compile.h) $(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@ \ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)" \ - "$(CONFIG_PREEMPT_RT)" "$(LD)" "$(CC) $(KBUILD_CFLAGS)" + "$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" "$(LD)" diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index 8b38a96163e2..5b80a4699740 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -6,8 +6,8 @@ ARCH=$2 SMP=$3 PREEMPT=$4 PREEMPT_RT=$5 -LD=$6 -CC=$7 +CC=$6 +LD=$7 -- Best Regards Masahiro Yamada