clang: workaround for generated constants
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. cc: Masahiro Yamada <yamada.m@jp.panasonic.com> cc: Tom Rini <trini@ti.com> Signed-off-by: Jeroen Hofstee <jeroen@myspectrum.nl>
This commit is contained in:
parent
f2cbb037a7
commit
fe5d1abcf4
3
Kbuild
3
Kbuild
@ -53,7 +53,8 @@ targets += arch/$(ARCH)/lib/asm-offsets.s
|
|||||||
|
|
||||||
# Default sed regexp - multiline due to syntax constraints
|
# Default sed regexp - multiline due to syntax constraints
|
||||||
define sed-y
|
define sed-y
|
||||||
"/^->/{s:->#\(.*\):/* \1 */:; \
|
"s:[[:space:]]*\.ascii[[:space:]]*\"\(.*\)\":\1:; \
|
||||||
|
/^->/{s:->#\(.*\):/* \1 */:; \
|
||||||
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
||||||
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \
|
||||||
s:->::; p;}"
|
s:->::; p;}"
|
||||||
|
@ -7,14 +7,14 @@
|
|||||||
#define __LINUX_KBUILD_H
|
#define __LINUX_KBUILD_H
|
||||||
|
|
||||||
#define DEFINE(sym, val) \
|
#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 OFFSET(sym, str, mem) \
|
||||||
DEFINE(sym, offsetof(struct str, mem))
|
DEFINE(sym, offsetof(struct str, mem))
|
||||||
|
|
||||||
#define COMMENT(x) \
|
#define COMMENT(x) \
|
||||||
asm volatile("\n->#" x)
|
asm volatile("\n.ascii \"->#" x "\"")
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user