Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3167847ybb; Mon, 6 Apr 2020 03:36:15 -0700 (PDT) X-Google-Smtp-Source: APiQypIj+UhM6c+B4sCrd0i2C4gLIPv2jMtRUyHWajKSr0GeoJhjTWfKHTWlAve/iUI+0wWymUiq X-Received: by 2002:aca:7517:: with SMTP id q23mr12252331oic.23.1586169375227; Mon, 06 Apr 2020 03:36:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586169375; cv=none; d=google.com; s=arc-20160816; b=osWDjlCf1pAdaXz6kUpiJ1gN/1m9Znz8S/ggtlhTMh2caM9frXi6yv9W6hx0lIoXXz 5MkSDd/tnVvGoj0ynWtQ9gy0B/eSalS4FxMg5MQ7H2+R1Qt7l3LTHnvzyPN1kUeYI8w8 z/7/kizRqb2dq7cQ4et3NRkdSAYMdLE+ITtESCS9ZG7iqajzaDSR5lkQEE/sNtj0cIV6 egq+ZDziRAuspRLi7ELWWTO/I5Y9Otv4feLqWrZ85xMkw/uao2HxlY1086zcOzofrQ6r y0Dnb1itEAFB477MwBlmfUdgUmAnGDjO1Hwif9EYoJ+YhJQeMAmhZJujKOakt0hmAcTv 0Hag== 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 :reply-to:in-reply-to:references:mime-version:dkim-signature; bh=ll9SSeRS7TM8pDXinZRrkXHz1Y8CIP/AsFc3Eg3lKHU=; b=LuTSTtRqWG/M3labaB+cUehplA8oliCDIcHiWk/G8WPAGYMPt+gyK/eCeVwAk9CEQ8 OUaDyFZ9LvZSFiUlooZILdi4FPgZPnf4S0SYwERSyW6CYni/5FONiwbvlQKcxrfZI5u0 IUxdtZIBhJsFw1AWvwHUVSBSAYIT53+DZhml34xErqLL7C2+zxGy+TRCNbYid7A2Xuy8 Zv+Wc6NpJuq52W5B7gwkQ2HdYc/Z/k86gj+/+TYqC0M5rBf97kokHpM9Z+0x5fFt7fsI eWAa1eY1DwBkTh0Z+EE5pl7cIih69RoFRjBmfNquz66v19kjxzBtWyW6FV7EBsc7mst3 OQJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KkHcB8mI; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si7740269ooh.57.2020.04.06.03.36.02; Mon, 06 Apr 2020 03:36:15 -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=@gmail.com header.s=20161025 header.b=KkHcB8mI; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727080AbgDFKfR (ORCPT + 99 others); Mon, 6 Apr 2020 06:35:17 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40515 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbgDFKfR (ORCPT ); Mon, 6 Apr 2020 06:35:17 -0400 Received: by mail-wr1-f67.google.com with SMTP id s8so14663356wrt.7; Mon, 06 Apr 2020 03:35:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=ll9SSeRS7TM8pDXinZRrkXHz1Y8CIP/AsFc3Eg3lKHU=; b=KkHcB8mIRe2csbG1xGClbvoCJEVvKMGwEC8sLetmFO5ZpLhVUU8OOisiY8+5IG4TUK 201f2E6NbeOBH05Dc6X8mx10e8cFXDTNcuK5mTD0msms0HC4ugCPD34jVVa1M4ocN46a xYmJEOGszwYHJ6ki+/5HCj9nIYwN8/SlUHxFjNUbnbqbQJ1GwecvTr+E0d9FOHFP818C 2u/dyhlxsYy0J0bL8A46ildZaH0isnc21X+aERIan3OXoI4PTsUW9n3+KFpnYq1T5IFH pWbkw6TLKMelfDlxuD9F+wJejPz/aJhUjp6GbQdbbxoCRuOFUB/uPIxRKolz+zdPa4R4 uG5g== 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:reply-to :from:date:message-id:subject:to:cc; bh=ll9SSeRS7TM8pDXinZRrkXHz1Y8CIP/AsFc3Eg3lKHU=; b=OkWyIOmnSkvwdiFMOMVBFBZ2lcf5F90kl3nDj+Y4tdoPXuXFbb/HuFKHLOhWxQyo0+ 30SxW9jXvhB9kxRboPmC7Hg+kMM+KbZ6V9tn3ql7yOixc0vFybRiQnSCG8nCfe3uK3VU Z3l8wrEonfFFnMilEvb6C0Zi7YuouV2m/tkItiPSBuDRN3cpXEaN4GdbD6RK8wb0Fnbk wlvtMEZLPeW2Cqo0/eNQavgnVSMH4/KWqO97KGwhMEI/WYlwYMgadDRx9Rskrjv0ea8U Vugibm9Q2r8wNLbFdWMJ5i+cQBADpatoQiaJR4clIOdEDM6Gd8jtIPAIRdpgepBDkrYY Oicw== X-Gm-Message-State: AGi0PuZtZgybh6CJnWOBJdXMZlJfMMtex8NnITzN8ooakHHJdRHS2BeA xmW14zJsyoWs+371hpsWMNzTpWBjOcWozDazMXw= X-Received: by 2002:adf:b64f:: with SMTP id i15mr4196654wre.351.1586169315956; Mon, 06 Apr 2020 03:35:15 -0700 (PDT) MIME-Version: 1.0 References: <202004020117.6E434C035@keescook> In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Mon, 6 Apr 2020 12:35:35 +0200 Message-ID: Subject: Re: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version To: Masahiro Yamada Cc: Kees Cook , Michal Marek , Thomas Gleixner , Linux Kbuild mailing list , Clang-Built-Linux ML , 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 On Sun, Apr 5, 2020 at 3:56 PM Masahiro Yamada wrote: > > On Sun, Apr 5, 2020 at 8:23 PM Sedat Dilek wrote: > > > > On Thu, Apr 2, 2020 at 4:24 PM Sedat Dilek wrote: > > > > > > On Thu, Apr 2, 2020 at 10:18 AM 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 > > > > > > > Please feel free and add: > > > > Reviewed-by: Sedat Dilek > > Tested-by: Sedat Dilek > > > Thanks. > > I collected all Reviewed-by and Tested-by. > How to test scripts/mkcompile_h? I did: $ cd /path/to/linux $ head -10 scripts/mkcompile_h #!/bin/sh # SPDX-License-Identifier: GPL-2.0 TARGET=$1 ARCH=$2 SMP=$3 PREEMPT=$4 PREEMPT_RT=$5 CC=$6 LD=$7 $ scripts/mkcompile_h include/generated/compile.h x86_64 SMP "" "" clang-10 ld.lld-10 UPD include/generated/compile.h $ cat include/generated/compile.h /* This file is auto generated, version 1 */ /* SMP */ #define UTS_MACHINE "x86_64" #define UTS_VERSION "#1 SMP Mon Apr 6 12:29:53 CEST 2020" #define LINUX_COMPILE_BY "dileks" #define LINUX_COMPILE_HOST "iniza" #define LINUX_COMPILER "clang version 10.0.0-2, LLD 10.0.0" This is with clang-10 and ld.lld-10 from Debian/unstable: $ clang-10 -v clang version 10.0.0-2 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/bin Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/8 Found candidate GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/9 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/8 Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9 Selected GCC installation: /usr/bin/../lib/gcc/x86_64-linux-gnu/10 Candidate multilib: .;@m64 Candidate multilib: 32;@m32 Candidate multilib: x32;@mx32 Selected multilib: .;@m64 $ ld.lld-10 -v LLD 10.0.0 (compatible with GNU linkers) Thanks. - sed@ -