linux/arch/loongarch/vdso
Tiezhu Yang cd5364ed17 LoongArch: Fix build failure with GCC 15 (-std=gnu23)
[ Upstream commit 947d5d036c ]

Whenever I try to build the kernel with upcoming GCC 15 which defaults
to -std=gnu23 I get a build failure:

  CC      arch/loongarch/vdso/vgetcpu.o
In file included from ./include/uapi/linux/posix_types.h:5,
                 from ./include/uapi/linux/types.h:14,
                 from ./include/linux/types.h:6,
                 from ./include/linux/kasan-checks.h:5,
                 from ./include/asm-generic/rwonce.h:26,
                 from ./arch/loongarch/include/generated/asm/rwonce.h:1,
                 from ./include/linux/compiler.h:317,
                 from ./include/asm-generic/bug.h:5,
                 from ./arch/loongarch/include/asm/bug.h:60,
                 from ./include/linux/bug.h:5,
                 from ./include/linux/mmdebug.h:5,
                 from ./include/linux/mm.h:6,
                 from ./arch/loongarch/include/asm/vdso.h:10,
                 from arch/loongarch/vdso/vgetcpu.c:6:
./include/linux/stddef.h:11:9: error: expected identifier before 'false'
   11 |         false   = 0,
      |         ^~~~~
./include/linux/types.h:35:33: error: two or more data types in declaration specifiers
   35 | typedef _Bool                   bool;
      |                                 ^~~~
./include/linux/types.h:35:1: warning: useless type name in empty declaration
   35 | typedef _Bool                   bool;
      | ^~~~~~~

The kernel builds explicitly with -std=gnu11 in top Makefile, but
arch/loongarch/vdso does not use KBUILD_CFLAGS from the rest of the
kernel, just add -std=gnu11 flag to arch/loongarch/vdso/Makefile.

By the way, commit e8c07082a8 ("Kbuild: move to -std=gnu11") did a
similar change for arch/arm64/kernel/vdso32/Makefile.

Fixes: c6b99bed6b ("LoongArch: Add VDSO and VSYSCALL support")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-05 14:02:29 +01:00
..
.gitignore LoongArch: Add build infrastructure 2022-06-03 20:09:27 +08:00
elf.S LoongArch: Add VDSO and VSYSCALL support 2022-06-03 20:09:28 +08:00
gen_vdso_offsets.sh LoongArch: Add VDSO and VSYSCALL support 2022-06-03 20:09:28 +08:00
Makefile LoongArch: Fix build failure with GCC 15 (-std=gnu23) 2024-12-05 14:02:29 +01:00
sigreturn.S LoongArch: Add VDSO and VSYSCALL support 2022-06-03 20:09:28 +08:00
vdso.lds.S LoongArch: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:35 +02:00
vdso.S LoongArch: Add VDSO and VSYSCALL support 2022-06-03 20:09:28 +08:00
vgetcpu.c LoongArch: Add support to clone a time namespace 2023-06-29 20:58:43 +08:00
vgetrandom-chacha.S LoongArch: vDSO: Tune chacha implementation 2024-09-24 14:21:05 +02:00
vgetrandom.c LoongArch: vDSO: Wire up getrandom() vDSO implementation 2024-09-13 17:28:35 +02:00
vgettimeofday.c arch: vdso: consolidate gettime prototypes 2023-11-23 11:32:32 +01:00