aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/asm/jump_label.h
diff options
context:
space:
mode:
authorVasily Gorbik <gor@linux.ibm.com>2019-12-25 14:13:32 +0100
committerVasily Gorbik <gor@linux.ibm.com>2020-01-22 13:05:35 +0100
commitc4e5c229b610ac974f284c760e47c40e651258f2 (patch)
tree06dcceb9bf6dafe8c2bf0092f9c806032ae09c73 /arch/s390/include/asm/jump_label.h
parents390/cpum_sf: Use DIV_ROUND_UP (diff)
downloadlinux-dev-c4e5c229b610ac974f284c760e47c40e651258f2.tar.xz
linux-dev-c4e5c229b610ac974f284c760e47c40e651258f2.zip
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 <ulrich.weigand@de.ibm.com> Acked-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to '')
-rw-r--r--arch/s390/include/asm/jump_label.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/s390/include/asm/jump_label.h b/arch/s390/include/asm/jump_label.h
index 39f747d63758..dcb1bba4f406 100644
--- a/arch/s390/include/asm/jump_label.h
+++ b/arch/s390/include/asm/jump_label.h
@@ -10,7 +10,9 @@
#define JUMP_LABEL_NOP_SIZE 6
#define JUMP_LABEL_NOP_OFFSET 2
-#if __GNUC__ < 9
+#ifdef CONFIG_CC_IS_CLANG
+#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "i"
+#elif __GNUC__ < 9
#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "X"
#else
#define JUMP_LABEL_STATIC_KEY_CONSTRAINT "jdd"