kbuild: fix asm-offset generation to work with clang
authorJeroen Hofstee <jeroen@myspectrum.nl>
Fri, 21 Apr 2017 06:21:11 +0000 (15:21 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Sun, 23 Apr 2017 06:51:26 +0000 (15:51 +0900)
commitcf0c3e68aa81f992b0301f62e341b710d385bf68
tree7645f9967cf133854eefd270ee84264cc3d614da
parent7dd47b95b0f54f2057d40af6e66d477e3fe95d13
kbuild: fix asm-offset generation to work with clang

KBuild abuses the asm statement to write to a file and
clang chokes about these invalid asm statements. Hack it
even more by fooling this is actual valid asm code.

[masahiro:
 Import Jeroen's work for U-Boot:
 http://patchwork.ozlabs.org/patch/375026/
 Tweak sed script a little to avoid garbage '#' for GCC case, like
 #define NR_PAGEFLAGS 23 /* __NR_PAGEFLAGS       # */ ]

Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Tested-by: Matthias Kaehlcke <mka@chromium.org>
include/linux/kbuild.h
scripts/Makefile.lib