Skip to content
  • Behan Webster's avatar
    kbuild, LLVMLinux: Fix asm-offset generation to work with clang · f99b2067
    Behan Webster authored and Vikram Narayanan's avatar Vikram Narayanan committed
    
    
    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: default avatarBehan Webster <behanw@converseincode.com>
    Reviewed-by: default avatarMark Charlebois <charlebm@gmail.com>
    Reviewed-by: default avatarJan-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>
    f99b2067