[PATCH v2 0/2] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files
Segher Boessenkool
segher at kernel.crashing.org
Wed Jun 11 06:00:28 AEST 2025
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
More information about the Linuxppc-dev
mailing list