linux-arch.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>,
	linux-kernel@vger.kernel.org
Cc: Arnd Bergmann <arnd@arndb.de>,
	linux-arch@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Andreas Larsson <andreas@gaisler.com>,
	sparclinux@vger.kernel.org
Subject: Re: [PATCH 34/41] sparc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers
Date: Mon, 4 Aug 2025 08:01:56 +0200	[thread overview]
Message-ID: <810a8ec4-e416-42b6-97bf-8a56f41deea1@redhat.com> (raw)
In-Reply-To: <5d9ab8b51a3281f249f514598c949d2c9ca6d194.camel@physik.fu-berlin.de>

On 03/08/2025 15.33, John Paul Adrian Glaubitz wrote:
> Hi Thomas,
> 
> On Fri, 2025-03-14 at 08:10 +0100, Thomas Huth wrote:
>> 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 on
>> the __ASSEMBLER__ macro that is provided by the compilers now.
>>
>> This is a completely mechanical patch (done with a simple "sed -i"
>> statement).
...
> This causes the kernel build to fail:
> 
>    CC [M]  drivers/gpu/drm/nouveau/nv04_fence.o
>    CC [M]  drivers/gpu/drm/nouveau/nv10_fence.o
>    CC [M]  drivers/gpu/drm/nouveau/nv17_fence.o
>    CC [M]  drivers/gpu/drm/nouveau/nv50_fence.o
>    CC [M]  drivers/gpu/drm/nouveau/nv84_fence.o
>    CC [M]  drivers/gpu/drm/nouveau/nvc0_fence.o
>    LD [M]  drivers/gpu/drm/nouveau/nouveau.o
>    AR      drivers/gpu/built-in.a
>    AR      drivers/built-in.a
> make: *** [Makefile:2026: .] Error 2
> glaubitz@node54:/data/home/glaubitz/linux> make
>    CALL    scripts/checksyscalls.sh
> <stdin>:1519:2: warning: #warning syscall clone3 not implemented [-Wcpp]
>    AS      arch/sparc/kernel/head_64.o
> ./arch/sparc/include/uapi/asm/ptrace.h: Assembler messages:
> ./arch/sparc/include/uapi/asm/ptrace.h:22: Error: Unknown opcode: `struct'
> ./arch/sparc/include/uapi/asm/ptrace.h:23: Error: Unknown opcode: `unsigned'
[...]

D'oh! I guess it's because sparc is using "asflags-y := -ansi" in it's 
Makefiles ? -ansi seems to change the behavior of the compiler so that 
__ASSEMBLER__ does not get defined anymore :-(

Do you know why sparc uses "-ansi" for the assembler files? I just tried to 
install the latest sparc64-linux-gnu-gcc on Fedora 42, and when I try to 
compile the kernel with that one, I even get earlier errors related to that 
flag:

   AS      arch/sparc/kernel/head_64.o
In file included from ./include/linux/atomic.h:80,
                  from ./include/asm-generic/bitops/lock.h:5,
                  from ./arch/sparc/include/asm/bitops_64.h:52,
                  from ./arch/sparc/include/asm/bitops.h:5,
                  from ./include/linux/bitops.h:67,
                  from ./include/linux/log2.h:12,
                  from ./include/asm-generic/getorder.h:8,
                  from ./arch/sparc/include/asm/page_64.h:158,
                  from ./arch/sparc/include/asm/page.h:6,
                  from ./arch/sparc/include/asm/pgtable_64.h:23,
                  from ./arch/sparc/include/asm/pgtable.h:5,
                  from ./include/linux/pgtable.h:6,
                  from arch/sparc/kernel/head_64.S:16:
./include/linux/atomic/atomic-arch-fallback.h:1:1: error: C++ style comments 
are not allowed in ISO C90
     1 | // SPDX-License-Identifier: GPL-2.0
       | ^
./include/linux/atomic/atomic-arch-fallback.h:1:1: note: (this will be 
reported only once per input file)
In file included from ./include/linux/atomic.h:81:
./include/linux/atomic/atomic-long.h:1:1: error: C++ style comments are not 
allowed in ISO C90
     1 | // SPDX-License-Identifier: GPL-2.0
       | ^
./include/linux/atomic/atomic-long.h:1:1: note: (this will be reported only 
once per input file)
In file included from ./include/linux/atomic.h:82:
./include/linux/atomic/atomic-instrumented.h:1:1: error: C++ style comments 
are not allowed in ISO C90
     1 | // SPDX-License-Identifier: GPL-2.0
       | ^

etc.

So using -ansi in the kernel sources nowadays sounds wrong to me ... could 
it be removed?

  Thomas


  reply	other threads:[~2025-08-04  6:02 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-14  7:09 [PATCH 00/41] treewide: Replace __ASSEMBLY__ with __ASSEMBLER__ in header files Thomas Huth
2025-03-14  7:09 ` [PATCH 01/41] uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 02/41] include: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 03/41] alpha: Replace __ASSEMBLY__ with __ASSEMBLER__ in the alpha headers Thomas Huth
2025-03-14  7:09 ` [PATCH 04/41] arc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 05/41] arc: Replace __ASSEMBLY__ with __ASSEMBLER__ in the non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 06/41] arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 07/41] arm: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 08/41] arm64: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14 11:55   ` Will Deacon
2025-03-14 12:05     ` Arnd Bergmann
2025-03-14 13:42       ` Will Deacon
2025-03-14 18:01         ` Thomas Huth
2025-03-14  7:09 ` [PATCH 09/41] arm64: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 10/41] csky: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi header Thomas Huth
2025-03-14  7:09 ` [PATCH 11/41] csky: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 12/41] hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 13/41] hexagon: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-04-08 15:16   ` Brian Cain
2025-03-14  7:09 ` [PATCH 14/41] loongarch: Replace __ASSEMBLY__ with __ASSEMBLER__ in the loongarch headers Thomas Huth
2025-03-14  7:09 ` [PATCH 15/41] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 16/41] m68k: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 17/41] microblaze: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-06-10 13:19   ` Michal Simek
2025-03-14  7:09 ` [PATCH 18/41] microblaze: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-06-10  7:26   ` Michal Simek
2025-06-10 13:19   ` Michal Simek
2025-03-14  7:09 ` [PATCH 19/41] mips: Replace __ASSEMBLY__ with __ASSEMBLER__ in the mips headers Thomas Huth
2025-03-20 12:56   ` Philippe Mathieu-Daudé
2025-03-14  7:09 ` [PATCH 20/41] nios2: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 21/41] nios2: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 22/41] openrisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-06-07  5:52   ` Stafford Horne
2025-03-14  7:09 ` [PATCH 23/41] openrisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-06-07  5:53   ` Stafford Horne
2025-03-14  7:09 ` [PATCH 24/41] parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-05-04 18:53   ` Helge Deller
2025-03-14  7:09 ` [PATCH 25/41] parisc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-05-04 18:53   ` Helge Deller
2025-03-14  7:09 ` [PATCH 26/41] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 27/41] powerpc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:09 ` [PATCH 28/41] riscv: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 29/41] riscv: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 30/41] s390/uapi: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 31/41] s390x: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 32/41] sh: Replace __ASSEMBLY__ with __ASSEMBLER__ in the SuperH headers Thomas Huth
2025-06-07 13:11   ` John Paul Adrian Glaubitz
2025-03-14  7:10 ` [PATCH 33/41] sparc: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 34/41] sparc: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-08-03 13:33   ` John Paul Adrian Glaubitz
2025-08-04  6:01     ` Thomas Huth [this message]
2025-08-04  8:00       ` Arnd Bergmann
2025-08-04 18:04         ` David Laight
2025-08-05  9:50     ` Thomas Huth
2025-03-14  7:10 ` [PATCH 35/41] um: Replace __ASSEMBLY__ with __ASSEMBLER__ in the usermode headers Thomas Huth
2025-03-18  9:59   ` Johannes Berg
2025-03-14  7:10 ` [PATCH 36/41] x86: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 37/41] x86: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 38/41] xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 39/41] xtensa: Replace __ASSEMBLY__ with __ASSEMBLER__ in non-uapi headers Thomas Huth
2025-03-14  7:10 ` [PATCH 40/41] scripts/dtc: Update fdt.h to the latest version Thomas Huth
2025-03-14 20:47   ` Rob Herring
2025-03-17  5:53     ` Thomas Huth
2025-03-14  7:10 ` [PATCH 41/41] treewide: Stop defining __ASSEMBLY__ for assembler files Thomas Huth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=810a8ec4-e416-42b6-97bf-8a56f41deea1@redhat.com \
    --to=thuth@redhat.com \
    --cc=andreas@gaisler.com \
    --cc=arnd@arndb.de \
    --cc=davem@davemloft.net \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sparclinux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).