Skip to content

Commit 169f899

Browse files
npigginmpe
authored andcommitted
powerpc/64s: Disable pcrel code model on Clang
Clang has a bug that casues the pcrel code model not to be used when any of -msoft-float, -mno-altivec, or -mno-vsx are set. Leaving these off causes FP/vector instructions to be generated, causing crashes. So disable pcrel for clang for now. Fixes: 7e3a68b ("powerpc/64: vmlinux support building with PCREL addresing") Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230426055848.402993-3-npiggin@gmail.com
1 parent 0c99330 commit 169f899

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

arch/powerpc/Kconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,12 @@ config CC_HAS_PREFIXED
88
def_bool PPC64 && $(cc-option, -mcpu=power10 -mprefixed)
99

1010
config CC_HAS_PCREL
11-
def_bool PPC64 && $(cc-option, -mcpu=power10 -mpcrel)
11+
# Clang has a bug (https://github.com/llvm/llvm-project/issues/62372)
12+
# where pcrel code is not generated if -msoft-float, -mno-altivec, or
13+
# -mno-vsx options are also given. Without these options, fp/vec
14+
# instructions are generated from regular kernel code. So Clang can't
15+
# do pcrel yet.
16+
def_bool PPC64 && CC_IS_GCC && $(cc-option, -mcpu=power10 -mpcrel)
1217

1318
config 32BIT
1419
bool

0 commit comments

Comments
 (0)