diff options
author | Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org> | 2016-03-30 00:46:09 +0200 |
---|---|---|
committer | Sumit Semwal <sumit.semwal@linaro.org> | 2016-12-20 22:17:06 +0530 |
commit | ed9c55d74c0e878fc033432c137472943793c202 (patch) | |
tree | 11e4500d839b7d094f12eab5714d10ec0b1bf675 /scripts | |
parent | 945583c8b98fd9f949dace83e1970a897d6c1c67 (diff) |
kbuild, LLVMLinux: Fix asm-offset generation to work with clang
When using clang with -no-integerated-as clang will use the gnu assembler instead
of the integrated assembler. However clang will still perform asm error checking
before sending the inline assembly language to gas.
The generation of asm-offsets from within C code is dependent on gcc's blind
passing of whatever is in asm() through to gas. Arbirary text is
passed through which is then modified by a sed script into the appropriate .h
and .S code. Since the arbitrary text is not valid assembly language, clang fails.
This can be fixed by making the arbitrary text into an ASM comment and then
updating the sed scripts accordingly to work as expected.
This solution works for both gcc and clang.
Signed-off-by: Behan Webster <behanw@converseincode.com>
Reviewed-by: Mark Charlebois <charlebm@gmail.com>
Reviewed-by: Jan-Simon Möller <dl9pf@gmx.de>
Cc: Jan Moskyto Matejka <mq@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: "H. Peter Anvin" <hpa@linux.intel.com>
Cc: Tom Gundersen <teg@jklm.no>
Cc: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/mod/Makefile | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/mod/Makefile b/scripts/mod/Makefile index c11212ff3510..86f6b852cd93 100644 --- a/scripts/mod/Makefile +++ b/scripts/mod/Makefile @@ -6,10 +6,10 @@ modpost-objs := modpost.o file2alias.o sumversion.o devicetable-offsets-file := devicetable-offsets.h define sed-y - "/^->/{s:->#\(.*\):/* \1 */:; \ - s:^->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ - s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ - s:->::; p;}" + "/^@->/{s:@->#\(.*\):/* \1 */:; \ + s:^@->\([^ ]*\) [\$$#]*\([-0-9]*\) \(.*\):#define \1 \2 /* \3 */:; \ + s:^@->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; \ + s:@->::; p;}" endef quiet_cmd_offsets = GEN $@ |