lkml.org 
[lkml]   [2020]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] kbuild: mkcompile_h: Include $LD version in /proc/version
On Mon, Apr 6, 2020 at 5:53 PM Kees Cook <keescook@chromium.org> wrote:
[ ... ]
> > 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
>

Thanks Kees.

# Clean-up
make distclean

# Prereq: Generate include/generated/autoconf.h file
cp -v /boot/config-5.6.0-2-amd64-clang .config
MAKE="make V=1" ; COMPILER="mycompiler" ; LINKER="mylinker" ;
MAKE_OPTS="CC=$COMPILER HOSTCC=$COMPILER LD=$LINKER HOSTLD=$LINKER"
yes "" | $MAKE $MAKE_OPTS oldconfig && $MAKE $MAKE_OPTS syncconfig < /dev/null

# Generate include/generated/compile.h file
$MAKE $MAKE_OPTS init/version.o

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 19:05: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"

- sed@ -

\
 
 \ /
  Last update: 2020-04-06 19:13    [W:0.044 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site