[llvm-dev] An error of asm goto occured while compiling Linux kernel 5.3

Will Lester via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 26 07:45:38 PDT 2019


Hi all,
I encountered an error while compiling Linux kernel 5.3 to IR.
My LLVM version is 9.0.0 release.
This error said "invalid operand for inline asm constraint 'i'" in
arch/x86/include/asm/jump_table.h.

The source code is
static __always_inline bool arch_static_branch(struct static_key *key,
bool branch)
{
asm_volatile_goto("1:"
".byte " __stringify(STATIC_KEY_INIT_NOP) "\n\t"
".pushsection __jump_table,  \"aw\" \n\t"
_ASM_ALIGN "\n\t"
".long 1b - ., %l[l_yes] - . \n\t"
_ASM_PTR "%c0 + %c1 - .\n\t"
".popsection \n\t"
: :  "i" (key), "i" (branch) : : l_yes);

return false;
l_yes:
return true;
}

The error pointed to asm_volatile_goto("1:"
I'm not sure whether this error is related to asm goto support.


More information about the llvm-dev mailing list