Skip to content

Commit

Permalink
powerpc/64s: Disable pcrel code model on Clang
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://msgid.link/[email protected]
  • Loading branch information
npiggin authored and mpe committed Apr 26, 2023
1 parent 0c99330 commit 169f899
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ config CC_HAS_PREFIXED
def_bool PPC64 && $(cc-option, -mcpu=power10 -mprefixed)

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

config 32BIT
bool
Expand Down

0 comments on commit 169f899

Please sign in to comment.