[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <810a8ec4-e416-42b6-97bf-8a56f41deea1@redhat.com>
Date: Mon, 4 Aug 2025 08:01:56 +0200
From: Thomas Huth <thuth@...hat.com>
To: John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>,
linux-kernel@...r.kernel.org
Cc: Arnd Bergmann <arnd@...db.de>, linux-arch@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>,
Andreas Larsson <andreas@...sler.com>, sparclinux@...r.kernel.org
Subject: Re: [PATCH 34/41] sparc: Replace __ASSEMBLY__ with __ASSEMBLER__ in
non-uapi headers
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@...e54:/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
Powered by blists - more mailing lists