[PATCH 1/5] kbuild: emit asm-offsets markers as .ascii strings

Ahmad Fatoum a.fatoum at pengutronix.de
Fri Sep 4 00:59:13 PDT 2026


From: Ahmad Fatoum <a.fatoum at barebox.org>

The DEFINE()/BLANK()/COMMENT() macros emit their "->" markers as bare
lines, which clang's integrated assembler rejects:

  arch/arm/lib/asm-offsets.c:16:3: error: unexpected token at start of statement

Switch to the .ascii form from Linux commit cf0c3e68aa81 ("kbuild: fix
asm-offset generation to work with clang"). $(sed-offsets) already
handles both forms and the generated header is byte-identical.

Assisted-by: Claude:fable-5
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
 include/linux/kbuild.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/kbuild.h b/include/linux/kbuild.h
index de0f9bdb952f..6023904b5b67 100644
--- a/include/linux/kbuild.h
+++ b/include/linux/kbuild.h
@@ -4,14 +4,14 @@
 #define __LINUX_KBUILD_H
 
 #define DEFINE(sym, val) \
-	asm volatile("\n->" #sym " %0 " #val : : "i" (val))
+	asm volatile("\n.ascii \"->" #sym " %0 " #val "\"" : : "i" (val))
 
-#define BLANK() asm volatile("\n->" : : )
+#define BLANK() asm volatile("\n.ascii \"->\"" : : )
 
 #define OFFSET(sym, str, mem) \
 	DEFINE(sym, offsetof(struct str, mem))
 
 #define COMMENT(x) \
-	asm volatile("\n->#" x)
+	asm volatile("\n.ascii \"->#" x "\"")
 
 #endif
-- 
2.47.3




More information about the barebox mailing list