public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2] arm: Replace ASSEMBLY with ASSEMBLER in uapi headers
@ 2026-02-28 12:13 Nick Huang
  2026-02-28 12:19 ` Thomas Weißschuh
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Huang @ 2026-02-28 12:13 UTC (permalink / raw)
  To: macro
  Cc: linux, davidgow, dongsheng.yang, dory85109, ebiggers, idryomov,
	jlayton, john.g.garry, namhyung, robh, sef1548, kusogame68, wdhh6,
	wqu, yot4106, likerockman102, squid, linux-arm-kernel,
	linux-kernel

While the transition from __ASSEMBLY__ to __ASSEMBLER__ is not a regression,
the use of the modern __ASSEMBLER__ macro requires a sufficiently recent
compiler (GCC 3.0+).

In some environments, userland might still be using ancient tools like
GCC 2.95.x, which does not natively define __ASSEMBLER__. To provide a
complete fix and prevent silent build issues or header ambiguity, add
an #error guard to catch unsupported toolchains.

Changes in v2:
- Added explicit #error check for GCC versions earlier than 3.0.
- Updated commit message to clarify the rationale for legacy toolchain support.
- Link to v1: https://lore.kernel.org/all/20260218133952.5356-1-sef1548@gmail.com/

Signed-off-by: Nick Huang <sef1548@gmail.com>
---
 arch/arm/include/uapi/asm/ptrace.h | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/include/uapi/asm/ptrace.h b/arch/arm/include/uapi/asm/ptrace.h
index 8896c23cc..51cfefeae 100644
--- a/arch/arm/include/uapi/asm/ptrace.h
+++ b/arch/arm/include/uapi/asm/ptrace.h
@@ -119,7 +119,12 @@
 #define PT_DATA_ADDR		0x10004
 #define PT_TEXT_END_ADDR	0x10008
 
-#ifndef __ASSEMBLY__
+#if defined(__GNUC__) && (__GNUC__ <  3)
+# error "GCC 3.0+ is required for proper __ASSEMBLER__ support. \
+Your compiler is too old to safely handle modern kernel assembly headers."
+#endif
+
+#ifndef __ASSEMBLER__ 
 
 /*
  * This struct defines the way the registers are stored on the
@@ -158,6 +163,6 @@ struct pt_regs {
 #define ARM_VFPREGS_SIZE ( 32 * 8 /*fpregs*/ + 4 /*fpscr*/ )
 
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__  */
 
 #endif /* _UAPI__ASM_ARM_PTRACE_H */
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-03-10 14:13 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-28 12:13 [PATCH v2] arm: Replace ASSEMBLY with ASSEMBLER in uapi headers Nick Huang
2026-02-28 12:19 ` Thomas Weißschuh
2026-02-28 12:45   ` Nick Huang
2026-03-01 20:12     ` Maciej W. Rozycki
2026-03-01 22:06       ` Thomas Weißschuh
2026-03-03 16:10       ` Nick Huang
2026-03-09 15:24       ` [PATCH v2] arm: Replace ASSEMBLY with ASSEMBLER in uapi Nick Huang
2026-03-09 16:01         ` Thomas Weißschuh
2026-03-10 14:13           ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox