From: Jan-Simon Möller Date: Wed, 14 Nov 2012 09:55:48 +0000 (+0100) Subject: kbuild: LLVMLinux: Fix LINUX_COMPILER definition script for compilation with clang X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=db46293bc6866a9bcffc9cb5b1ae9c46e4f83fa7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git kbuild: LLVMLinux: Fix LINUX_COMPILER definition script for compilation with clang When building the LINUX_COMPILER definition, instead of merely taking the last line from "$(CC) -v", grep for ' version ' in the output. This supports both gcc and clang. Signed-off-by: Jan-Simon Möller Signed-off-by: Behan Webster Signed-off-by: Mark Charlebois Cc: PaX Team --- diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h index f221ddf69080..cfb8440cc0b2 100755 --- a/scripts/mkcompile_h +++ b/scripts/mkcompile_h @@ -76,7 +76,7 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" echo \#define LINUX_COMPILE_BY \"`echo $LINUX_COMPILE_BY | $UTS_TRUNCATE`\" echo \#define LINUX_COMPILE_HOST \"`echo $LINUX_COMPILE_HOST | $UTS_TRUNCATE`\" - echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | tail -n 1`\" + echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version '`\" ) > .tmpcompile # Only replace the real compile.h if the new one is different,