linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nicholas Piggin <npiggin@gmail.com>
To: linuxppc-dev@lists.ozlabs.org
Cc: Nicholas Piggin <npiggin@gmail.com>
Subject: [PATCH 2/9] powerpc/64s: Disable pcrel code model on Clang
Date: Wed, 26 Apr 2023 15:58:39 +1000	[thread overview]
Message-ID: <20230426055848.402993-3-npiggin@gmail.com> (raw)
In-Reply-To: <20230426055848.402993-1-npiggin@gmail.com>

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.

Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
---
 arch/powerpc/Kconfig | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 7a0f25a09759..261e9453b43c 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -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
-- 
2.40.0


  parent reply	other threads:[~2023-04-26  6:01 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-26  5:58 [PATCH 0/9] powerpc: Build fixes Nicholas Piggin
2023-04-26  5:58 ` [PATCH 1/9] powerpc: Fix merge conflict between pcrel and copy_thread changes Nicholas Piggin
2023-04-26  5:58 ` Nicholas Piggin [this message]
2023-04-26  5:58 ` [PATCH 3/9] powerpc/boot: Seperate target flags from BOOTCFLAGS Nicholas Piggin
2023-04-26  5:58 ` [PATCH 4/9] powerpc/boot: Seperate CPP " Nicholas Piggin
2023-04-26  5:58 ` [PATCH 5/9] powerpc/boot: Separate BOOTCFLAGS from BOOTASFLAGS Nicholas Piggin
2023-04-26 15:11   ` Linus Torvalds
2023-04-26  5:58 ` [PATCH 6/9] powerpc/boot: Clean up Makefile after cflags and asflags separation Nicholas Piggin
2023-04-26  5:58 ` [PATCH 6/9] powerpc/boot: clean up Makefile flags Nicholas Piggin
2023-04-26  5:58 ` [PATCH 7/9] powerpc/build: Remove -pipe from compilation flags Nicholas Piggin
2023-04-26  5:58 ` [PATCH 8/9] powerpc/64s: Permit d-form memops in asm when building with prefix on clang Nicholas Piggin
2023-04-26  5:58 ` [PATCH 9/9] powerpc/64s: Work around llvm-as not recognising pla Nicholas Piggin
2023-04-26 12:01 ` (subset) [PATCH 0/9] powerpc: Build fixes Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230426055848.402993-3-npiggin@gmail.com \
    --to=npiggin@gmail.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).