[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202004060851.CCB538AD1@keescook>
Date: Mon, 6 Apr 2020 08:53:35 -0700
From: Kees Cook <keescook@...omium.org>
To: Sedat Dilek <sedat.dilek@...il.com>
Cc: Masahiro Yamada <masahiroy@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Thomas Gleixner <tglx@...utronix.de>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
Clang-Built-Linux ML <clang-built-linux@...glegroups.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version
On Mon, Apr 06, 2020 at 12:35:35PM +0200, Sedat Dilek wrote:
> On Sun, Apr 5, 2020 at 3:56 PM Masahiro Yamada <masahiroy@...nel.org> wrote:
> >
> > On Sun, Apr 5, 2020 at 8:23 PM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > >
> > > On Thu, Apr 2, 2020 at 4:24 PM Sedat Dilek <sedat.dilek@...il.com> wrote:
> > > >
> > > > On Thu, Apr 2, 2020 at 10:18 AM Kees Cook <keescook@...omium.org> 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 <keescook@...omium.org>
> > > >
> > >
> > > Please feel free and add:
> > >
> > > Reviewed-by: Sedat Dilek <sedat.dilek@...il.com>
> > > Tested-by: Sedat Dilek <sedat.dilek@...il.com>
> >
> >
> > Thanks.
> >
> > I collected all Reviewed-by and Tested-by.
> >
>
> How to test scripts/mkcompile_h?
There's probably a better way, but I do:
$ rm include/generated/compile.h init/version.o
$ make init/version.o
$ cat include/generated/compile.h
-Kees
>
> 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@ -
--
Kees Cook
Powered by blists - more mailing lists