No idea why kernel 6.15 is brought to this discussion when the issue is with GCC. GCC 15 switched over to C23 by default, so one needs to specify C17 ala https://gitlab.archlinux.org/archlinux/packaging/packages/nvidia-utils/-/blob/main/0002-CFLAGS-Set-std-gnu17-for-all-compilation-flags.patch
gcc-15.patch:
diff --git a/kernel/Kbuild b/kernel/Kbuild
index 85aa267..baa6986 100644
--- a/kernel/Kbuild
+++ b/kernel/Kbuild
@@ -61,6 +61,7 @@ $(foreach _module, $(NV_KERNEL_MODULES), \
# $(EXTRA_CFLAGS) to ccflags-y for compatibility.
#
+EXTRA_CFLAGS += -std=gnu17
EXTRA_CFLAGS += -I$(src)/common/inc
EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wsign-compare -Wno-cast-qual -Wno-error
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
index 4da7588..1106ea5 100755
--- a/kernel/conftest.sh
+++ b/kernel/conftest.sh
@@ -151,7 +151,7 @@ test_headers() {
}
build_cflags() {
- BASE_CFLAGS="-O2 -D__KERNEL__ \
+ BASE_CFLAGS="-std=gnu17 -O2 -D__KERNEL__ \
-DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\" \
-nostdinc -isystem $ISYSTEM \
-Wno-implicit-function-declaration -Wno-strict-prototypes -Wno-incompatible-pointer-types"
I'll let maintainers decide on the rest, gcc-14.patch and so on. I just applied it on top of everything.
Pinned Comments
vnctdj commented on 2025-01-24 07:37 (UTC)
Use this forum thread for discussion: https://bbs.archlinux.org/viewtopic.php?pid=1946926
jonathon commented on 2022-05-26 09:46 (UTC)
Please don't flag this package out-of-date unless a new version has been released by NVIDIA.
jonathon commented on 2021-12-26 22:44 (UTC) (edited on 2021-12-26 22:44 (UTC) by jonathon)
The DKMS package guidelines are explicit that
linux-headers
should not be a dependency of any DKMS package.As a concrete example of why including that as a hard dependency is a bad idea, what happens when
linux
is not an installed kernel?