Re: [PATCH v2 0/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files

From
Segher Boessenkool <hidden>
Date
2025-06-10 20:09:02
Reply to
Thomas Huth, 2025-06-10
On Tue, Jun 10, 2025 at 06:01:26PM +0200, Thomas Huth wrote:
The kernel Makefiles define the __ASSEMBLY__ macro to provide
a way to use headers in both, assembly and C source code.
However, all the supported versions of the GCC and Clang compilers
also define the macro __ASSEMBLER__ automatically already when compiling
assembly code, so some kernel headers are using __ASSEMBLER__ instead.
With regards to userspace code, this seems also to be constant source
of confusion, see for example these links here:
Any symbol name starting with two underscores is reserved for any use.

That also means that the kernel (being user code!) is not allowed to use
such for its own use.

But the kernel historically defines stuff in this namespace anyway.  Of
course it cannot prohibit others to do the same though!
To avoid confusion in the future, it would make sense to standardize
on the macro that gets defined by the compiler, so this patch series
changes all occurances of __ASSEMBLY__ into __ASSEMBLER__.
GCC already defines __ASSEMBLER__ when compiling assembler code (a .s
or .S file, usually).  LLVM should do the same, it promises to be
compatible to GCC for all user code, after all.


Segher
Thread (9 messages) 9 messages, 2 authors, last reply 2025-06-11
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help