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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Nov 2018 07:20:35 +0000 (08:20 +0100)
commitb53c7372d667767420cf86a1f02708e7bacfdb12
tree608f1aa82cf3776f8f218c6ef96459d9ff419297
parentc36ae15ceb627305a063e60d005c592f46bc7806
kbuild: fix asm-offset generation to work with clang

commit cf0c3e68aa81f992b0301f62e341b710d385bf68 upstream.

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>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/kbuild.h
scripts/Makefile.lib