Skip to content

Commit c4e5c22

Browse files
author
Vasily Gorbik
committed
s390/jump_label: use "i" constraint for clang
Currently kernel build fails under clang if jump labels are enabled. The problem is "X" constraint usage "Any operand whatsoever is allowed", for which clang produces the following: .pushsection __jump_table,"aw" .balign 8 .long 0b-.,.Ltmp577-. .quad %r0+0-. # %r0 is not allowed here .popsection Under gcc constraints "X" or "jdd" (gcc > 9) are used for static keys. Ideally, we'd have used "i" for gcc, but it doesn't work in all cases with -fPIC code. This is gcc-specific problem that doesn't exist in llvm. Since clang does not have "jdd" simply always use "i" constraint for it. Suggested-by: Ulrich Weigand <[email protected]> Acked-by: Heiko Carstens <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
1 parent ee09c91 commit c4e5c22

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/s390/include/asm/jump_label.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
#define JUMP_LABEL_NOP_SIZE 6
1111
#define JUMP_LABEL_NOP_OFFSET 2
1212

13-
#if __GNUC__ < 9
13+
#ifdef CONFIG_CC_IS_CLANG
14+
#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "i"
15+
#elif __GNUC__ < 9
1416
#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "X"
1517
#else
1618
#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "jdd"

0 commit comments

Comments
 (0)