Re: arch/riscv/include/asm/jump_label.h:42:3: error: invalid operand for inline asm constraint 'i'

From: Nathan Chancellor
Date: Mon Aug 15 2022 - 18:57:10 EST


On Sun, Aug 14, 2022 at 05:10:53PM +0800, kernel test robot wrote:
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: aea23e7c464bfdec04b52cf61edb62030e9e0d0a
> commit: 8eb060e10185cfc97ef0200d197ec246ba0f9f8c arch/riscv: add Zihintpause support
> date: 3 days ago
> config: riscv-randconfig-r005-20220814 (https://download.01.org/0day-ci/archive/20220814/202208141746.ABdEd5xo-lkp@xxxxxxxxx/config)
> compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 3329cec2f79185bafd678f310fafadba2a8c76d2)
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # install riscv cross compiling tool for clang build
> # apt-get install binutils-riscv64-linux-gnu
> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8eb060e10185cfc97ef0200d197ec246ba0f9f8c
> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> git fetch --no-tags linus master
> git checkout 8eb060e10185cfc97ef0200d197ec246ba0f9f8c
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=riscv prepare
>
> If you fix the issue, kindly add following tag where applicable
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>
> All errors (new ones prefixed by >>):
>
> In file included from <built-in>:4:
> In file included from lib/vdso/gettimeofday.c:5:
> In file included from include/vdso/datapage.h:17:
> In file included from include/vdso/processor.h:10:
> In file included from arch/riscv/include/asm/vdso/processor.h:7:
> In file included from include/linux/jump_label.h:112:
> >> arch/riscv/include/asm/jump_label.h:42:3: error: invalid operand for inline asm constraint 'i'
> " .option push \n\t"
> ^
> 1 error generated.
> make[2]: *** [scripts/Makefile.build:249: arch/riscv/kernel/vdso/vgettimeofday.o] Error 1
> make[2]: Target 'include/generated/vdso-offsets.h' not remade because of errors.
> make[1]: *** [arch/riscv/Makefile:128: vdso_prepare] Error 2
> make[1]: Target 'prepare' not remade because of errors.
> make: *** [Makefile:219: __sub-make] Error 2
> make: Target 'prepare' not remade because of errors.

Just for the record, GCC 12.1.0 fails in the same way with the same
configuration (I didn't look into the problem beyond that):

In file included from <command-line>:
In function 'arch_static_branch_jump',
inlined from 'cpu_relax' at arch/riscv/include/asm/vdso/processor.h:13:7:
include/linux/compiler_types.h:285:33: warning: 'asm' operand 0 probably does not match constraints
285 | #define asm_volatile_goto(x...) asm goto(x)
| ^~~
arch/riscv/include/asm/jump_label.h:41:9: note: in expansion of macro 'asm_volatile_goto'
41 | asm_volatile_goto(
| ^~~~~~~~~~~~~~~~~
include/linux/compiler_types.h:285:33: error: impossible constraint in 'asm'
285 | #define asm_volatile_goto(x...) asm goto(x)
| ^~~
arch/riscv/include/asm/jump_label.h:41:9: note: in expansion of macro 'asm_volatile_goto'
41 | asm_volatile_goto(
| ^~~~~~~~~~~~~~~~~
make[3]: *** [scripts/Makefile.build:249: arch/riscv/kernel/vdso/vgettimeofday.o] Error 1

Cheers,
Nathan