mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
@ 2026-06-19 15:57 Thomas Huth
  2026-08-08  9:39 ` [tip: objtool/core] " tip-bot2 for Thomas Huth
  2026-08-11 13:06 ` [PATCH] " Manuel Ebner
  0 siblings, 2 replies; 4+ messages in thread
From: Thomas Huth @ 2026-06-19 15:57 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel

From: Thomas Huth <thuth@redhat.com>

While the GCC and Clang compilers already define __ASSEMBLER__
automatically when compiling assembly code, __ASSEMBLY__ is a
macro that only gets defined by the Makefiles in the kernel.
This can be very confusing when switching between userspace
and kernelspace coding, or when dealing with uapi headers that
rather should use __ASSEMBLER__ instead. So let's standardize now
on the __ASSEMBLER__ macro that is provided by the compilers.

This is a completely mechanical patch (done with a simple "sed -i"
statement).

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Note: This patch has been split from an earlier bigger patch of
 mine to ease reviewing.

 include/linux/objtool.h       | 8 ++++----
 include/linux/objtool_types.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 9a00e701454c5..af2e68e496e5d 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -7,7 +7,7 @@
 
 #ifdef CONFIG_OBJTOOL
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #define UNWIND_HINT(type, sp_reg, sp_offset, signal)		\
 	"987: \n\t"						\
@@ -53,7 +53,7 @@
 
 #define __ASM_BREF(label)	label ## b
 
-#else /* __ASSEMBLY__ */
+#else /* __ASSEMBLER__ */
 
 /*
  * In asm, there are two kinds of code: normal C-type callable functions and
@@ -102,11 +102,11 @@
 #endif
 .endm
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #else /* !CONFIG_OBJTOOL */
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #define UNWIND_HINT(type, sp_reg, sp_offset, signal) "\n\t"
 #define STACK_FRAME_NON_STANDARD(func)
diff --git a/include/linux/objtool_types.h b/include/linux/objtool_types.h
index c6def4049b1ae..c24e9ea392696 100644
--- a/include/linux/objtool_types.h
+++ b/include/linux/objtool_types.h
@@ -2,7 +2,7 @@
 #ifndef _LINUX_OBJTOOL_TYPES_H
 #define _LINUX_OBJTOOL_TYPES_H
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <linux/types.h>
 
@@ -18,7 +18,7 @@ struct unwind_hint {
 	u8		signal;
 };
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 /*
  * UNWIND_HINT_TYPE_UNDEFINED: A blind spot in ORC coverage which can result in
-- 
2.54.0


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

* [tip: objtool/core] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
  2026-06-19 15:57 [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files Thomas Huth
@ 2026-08-08  9:39 ` tip-bot2 for Thomas Huth
  2026-08-11 13:06 ` [PATCH] " Manuel Ebner
  1 sibling, 0 replies; 4+ messages in thread
From: tip-bot2 for Thomas Huth @ 2026-08-08  9:39 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: Thomas Huth, Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     6e5716b187faf50e5d33f0986ea25827cbdaa294
Gitweb:        https://git.kernel.org/tip/6e5716b187faf50e5d33f0986ea25827cbdaa294
Author:        Thomas Huth <thuth@redhat.com>
AuthorDate:    Fri, 19 Jun 2026 17:57:33 +02:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 07 Aug 2026 18:27:18 +02:00

objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files

While the GCC and Clang compilers already define __ASSEMBLER__
automatically when compiling assembly code, __ASSEMBLY__ is a
macro that only gets defined by the Makefiles in the kernel.
This can be very confusing when switching between userspace
and kernelspace coding, or when dealing with uapi headers that
rather should use __ASSEMBLER__ instead. So let's standardize now
on the __ASSEMBLER__ macro that is provided by the compilers.

This is a completely mechanical patch (done with a simple "sed -i"
statement).

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260619155733.58852-1-thuth@redhat.com
---
 include/linux/objtool.h       | 8 ++++----
 include/linux/objtool_types.h | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/include/linux/objtool.h b/include/linux/objtool.h
index 9a00e70..af2e68e 100644
--- a/include/linux/objtool.h
+++ b/include/linux/objtool.h
@@ -7,7 +7,7 @@
 
 #ifdef CONFIG_OBJTOOL
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #define UNWIND_HINT(type, sp_reg, sp_offset, signal)		\
 	"987: \n\t"						\
@@ -53,7 +53,7 @@
 
 #define __ASM_BREF(label)	label ## b
 
-#else /* __ASSEMBLY__ */
+#else /* __ASSEMBLER__ */
 
 /*
  * In asm, there are two kinds of code: normal C-type callable functions and
@@ -102,11 +102,11 @@
 #endif
 .endm
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 #else /* !CONFIG_OBJTOOL */
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #define UNWIND_HINT(type, sp_reg, sp_offset, signal) "\n\t"
 #define STACK_FRAME_NON_STANDARD(func)
diff --git a/include/linux/objtool_types.h b/include/linux/objtool_types.h
index c6def40..c24e9ea 100644
--- a/include/linux/objtool_types.h
+++ b/include/linux/objtool_types.h
@@ -2,7 +2,7 @@
 #ifndef _LINUX_OBJTOOL_TYPES_H
 #define _LINUX_OBJTOOL_TYPES_H
 
-#ifndef __ASSEMBLY__
+#ifndef __ASSEMBLER__
 
 #include <linux/types.h>
 
@@ -18,7 +18,7 @@ struct unwind_hint {
 	u8		signal;
 };
 
-#endif /* __ASSEMBLY__ */
+#endif /* __ASSEMBLER__ */
 
 /*
  * UNWIND_HINT_TYPE_UNDEFINED: A blind spot in ORC coverage which can result in

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

* Re: [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
  2026-06-19 15:57 [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files Thomas Huth
  2026-08-08  9:39 ` [tip: objtool/core] " tip-bot2 for Thomas Huth
@ 2026-08-11 13:06 ` Manuel Ebner
  2026-08-11 13:23   ` Thomas Huth
  1 sibling, 1 reply; 4+ messages in thread
From: Manuel Ebner @ 2026-08-11 13:06 UTC (permalink / raw)
  To: Thomas Huth, Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel, Manuel Ebner

Hi Thomas,

I have been building the next kernel:

 Version: next-20260810
 make defconfig
 make KCFLAGS=-Werror -j8 > make_output.txt

I get following warning:
 Warning: Kernel ABI header at 'tools/include/linux/objtool_types.h' differs from latest version at 'include/linux/objtool_types.h'

The build continues and succeeds.

On Fri, 2026-06-19 at 17:57 +0200, Thomas Huth wrote:
> From: Thomas Huth <thuth@redhat.com>
> 
> While the GCC and Clang compilers already define __ASSEMBLER__
> automatically when compiling assembly code, __ASSEMBLY__ is a
> macro that only gets defined by the Makefiles in the kernel.
> This can be very confusing when switching between userspace
> and kernelspace coding, or when dealing with uapi headers that
> rather should use __ASSEMBLER__ instead. So let's standardize now
> on the __ASSEMBLER__ macro that is provided by the compilers.
> 
> This is a completely mechanical patch (done with a simple "sed -i"
> statement).

This warning can be fixed OR shut down by updating tools/include/linux/objtool_types.h with the same replacement.

> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  Note: This patch has been split from an earlier bigger patch of
>  mine to ease reviewing.
> 
>  include/linux/objtool.h       | 8 ++++----
>  include/linux/objtool_types.h | 4 ++--

Because of this file change I think this patch is related to the warning:
 Warning: Kernel ABI header at 'tools/include/linux/objtool_types.h' differs from latest version at 'include/linux/objtool_types.h'

Please advice, Thanks.
 Manuel Ebner

>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/linux/objtool.h b/include/linux/objtool.h
> index 9a00e701454c5..af2e68e496e5d 100644
> --- a/include/linux/objtool.h
> +++ b/include/linux/objtool.h
> @@ -7,7 +7,7 @@
>  
>  #ifdef CONFIG_OBJTOOL
>  
> -#ifndef __ASSEMBLY__
> +#ifndef __ASSEMBLER__
>  
>  #define UNWIND_HINT(type, sp_reg, sp_offset, signal)		\
>  	"987: \n\t"						\
> @@ -53,7 +53,7 @@
>  
>  #define __ASM_BREF(label)	label ## b
>  
> -#else /* __ASSEMBLY__ */
> +#else /* __ASSEMBLER__ */
>  
>  /*
>   * In asm, there are two kinds of code: normal C-type callable functions and
> @@ -102,11 +102,11 @@
>  #endif
>  .endm
>  
> -#endif /* __ASSEMBLY__ */
> +#endif /* __ASSEMBLER__ */
>  
>  #else /* !CONFIG_OBJTOOL */
>  
> -#ifndef __ASSEMBLY__
> +#ifndef __ASSEMBLER__
>  
>  #define UNWIND_HINT(type, sp_reg, sp_offset, signal) "\n\t"
>  #define STACK_FRAME_NON_STANDARD(func)
> diff --git a/include/linux/objtool_types.h b/include/linux/objtool_types.h
> index c6def4049b1ae..c24e9ea392696 100644
> --- a/include/linux/objtool_types.h
> +++ b/include/linux/objtool_types.h
> @@ -2,7 +2,7 @@
>  #ifndef _LINUX_OBJTOOL_TYPES_H
>  #define _LINUX_OBJTOOL_TYPES_H
>  
> -#ifndef __ASSEMBLY__
> +#ifndef __ASSEMBLER__
>  
>  #include <linux/types.h>
>  
> @@ -18,7 +18,7 @@ struct unwind_hint {
>  	u8		signal;
>  };
>  
> -#endif /* __ASSEMBLY__ */
> +#endif /* __ASSEMBLER__ */
>  
>  /*
>   * UNWIND_HINT_TYPE_UNDEFINED: A blind spot in ORC coverage which can result in

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

* Re: [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
  2026-08-11 13:06 ` [PATCH] " Manuel Ebner
@ 2026-08-11 13:23   ` Thomas Huth
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Huth @ 2026-08-11 13:23 UTC (permalink / raw)
  To: Manuel Ebner, Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel, Ingo Molnar

On 11/08/2026 15.06, Manuel Ebner wrote:
> Hi Thomas,
> 
> I have been building the next kernel:
> 
>   Version: next-20260810
>   make defconfig
>   make KCFLAGS=-Werror -j8 > make_output.txt
> 
> I get following warning:
>   Warning: Kernel ABI header at 'tools/include/linux/objtool_types.h' differs from latest version at 'include/linux/objtool_types.h'
> 
> The build continues and succeeds.
...
> This warning can be fixed OR shut down by updating tools/include/linux/objtool_types.h with the same replacement.
Sorry for that!

I've got a mail already earlier today about this, looks like Ingo already 
sent a fix:

  https://lore.kernel.org/lkml/178643815674.442315.17965640706499490354.tip-bot2@tip-bot2/

So I assume I don't have to send a v2 of my patch, do I?

  Thomas


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

end of thread, other threads:[~2026-08-11 13:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-19 15:57 [PATCH] objtool: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files Thomas Huth
2026-08-08  9:39 ` [tip: objtool/core] " tip-bot2 for Thomas Huth
2026-08-11 13:06 ` [PATCH] " Manuel Ebner
2026-08-11 13:23   ` Thomas Huth

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®