From: Shung-Hsi Yu <shung-hsi.yu@suse.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Michael Ellerman <mpe@ellerman.id.au>
Cc: "Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Christophe Leroy" <christophe.leroy@csgroup.eu>,
"Naveen N Rao" <naveen@kernel.org>,
"Nathan Chancellor" <nathan@kernel.org>,
"Nick Desaulniers" <ndesaulniers@google.com>,
"Bill Wendling" <morbo@google.com>,
"Justin Stitt" <justinstitt@google.com>,
"Segher Boessenkool" <segher@kernel.crashing.org>,
"Vitaly Chikunov" <vt@altlinux.org>,
"Michal Suchánek" <msuchanek@suse.de>,
"Abhishek Dubey" <dubeyabhishek777@gmail.com>,
"Yonghong Song" <yonghong.song@linux.dev>,
"Shung-Hsi Yu" <shung-hsi.yu@suse.com>
Subject: [PATCH 1/1] powerpc: use __clang__ instead of CONFIG_CC_IS_CLANG
Date: Tue, 18 Feb 2025 12:48:01 +0800 [thread overview]
Message-ID: <20250218044802.17302-1-shung-hsi.yu@suse.com> (raw)
Due to include chain (below), powerpc's asm-compat.h is part of UAPI,
thus it should use the __clang__ macro to directly detect whether Clang
is used rather then relying on the kernel config setting. The later is
unreliable because the userspace tools that uses UAPI may be compile
with a different compiler than the one used for the kernel, leading to
incorrect constrain selection (see link for an example of such).
include/uapi/linux/ptrace.h
arch/powerpc/include/asm/ptrace.h
arch/powerpc/include/asm/paca.h
arch/powerpc/include/asm/atomic.h
arch/powerpc/include/asm/asm-compat.h
Link: https://github.com/iovisor/bcc/issues/5172
Signed-off-by: Shung-Hsi Yu <shung-hsi.yu@suse.com>
---
arch/powerpc/include/asm/asm-compat.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/include/asm/asm-compat.h b/arch/powerpc/include/asm/asm-compat.h
index f48e644900a2..34f8740909a9 100644
--- a/arch/powerpc/include/asm/asm-compat.h
+++ b/arch/powerpc/include/asm/asm-compat.h
@@ -37,7 +37,7 @@
#define STDX_BE stringify_in_c(stdbrx)
#endif
-#ifdef CONFIG_CC_IS_CLANG
+#ifdef __clang__
#define DS_FORM_CONSTRAINT "Z<>"
#else
#define DS_FORM_CONSTRAINT "YZ<>"
--
2.48.1
next reply other threads:[~2025-02-18 4:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-18 4:48 Shung-Hsi Yu [this message]
2025-02-18 7:54 ` Michal Suchánek
2025-02-18 9:03 ` Shung-Hsi Yu
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=20250218044802.17302-1-shung-hsi.yu@suse.com \
--to=shung-hsi.yu@suse.com \
--cc=christophe.leroy@csgroup.eu \
--cc=dubeyabhishek777@gmail.com \
--cc=justinstitt@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=morbo@google.com \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
--cc=nathan@kernel.org \
--cc=naveen@kernel.org \
--cc=ndesaulniers@google.com \
--cc=npiggin@gmail.com \
--cc=segher@kernel.crashing.org \
--cc=vt@altlinux.org \
--cc=yonghong.song@linux.dev \
/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
all inboxes | Powered by JetHome®