summaryrefslogtreecommitdiff
path: root/include/linux/kbuild.h
diff options
context:
space:
mode:
authorJeroen Hofstee <jeroen@myspectrum.nl>2017-04-21 15:21:11 +0900
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-04-23 15:51:26 +0900
commitcf0c3e68aa81f992b0301f62e341b710d385bf68 (patch)
tree7645f9967cf133854eefd270ee84264cc3d614da /include/linux/kbuild.h
parent7dd47b95b0f54f2057d40af6e66d477e3fe95d13 (diff)
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>
Diffstat (limited to 'include/linux/kbuild.h')
-rw-r--r--include/linux/kbuild.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h
index 22a72198c14b..4e80f3a9ad58 100644
--- a/include/linux/kbuild.h
+++ b/include/linux/kbuild.h
@@ -2,14 +2,14 @@
#define __LINUX_KBUILD_H
#define DEFINE(sym, val) \
- asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+ asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
-#define BLANK() asm volatile("\n->" : : )
+#define BLANK() asm volatile("\n.ascii \"->\"" : : )
#define OFFSET(sym, str, mem) \
DEFINE(sym, offsetof(struct str, mem))
#define COMMENT(x) \
- asm volatile("\n->#" x)
+ asm volatile("\n.ascii \"->#" x "\"")
#endif