Skip to contentSkip to conversation

scripts/mkcompile_h: Remove trailing spaces from compiler version

PATCH In review Jonathan Liu 2 participants 2 messages Jun 12, 2017 – Jun 19, 2017 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scripts/mkcompile_h: Remove trailing spaces from compiler version

Improves the output of "cat /proc/version" by getting rid of the trailing space at the end of the compiler version when the kernel is compiled using GCC.

---
 scripts/mkcompile_h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mkcompile_h +1 -1
index 6fdc97ef6023..fd8fdb91581d 100755
@@ -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 | grep ' version '`\"
+  echo \#define LINUX_COMPILER \"`$CC -v 2>&1 | grep ' version ' | sed 's/[[:space:]]*$//'`\"
 ) > .tmpcompile
 
 # Only replace the real compile.h if the new one is different,
Signature · 1 line
2.12.2
#1 lore raw

2017-06-12 17:23 GMT+09:00 Jonathan Liu <[email protected]>:

Quoted 6 lines

Improves the output of "cat /proc/version" by getting rid of the trailing space at the end of the compiler version when the kernel is compiled using GCC.

---

Applied to linux-kbuild/misc. Thanks!

Signature · 2 lines
Best Regards
Masahiro Yamada