commit a01637562f936723843ee29fa3c998f9e4bbc0bb
Author: Łukasz Wojniłowicz <lukasz.wojnilowicz(a)gmail.com>
Date: Tue Apr 9 21:41:05 2024 +0200
Fix build on gcc-14
gcc-14.patch | 13 +++++++++++++
kernel-6.6.8.patch | 11 -----------
kernel-6.8.2.patch | 15 +++++++++++++++
nvidia-340xx-kmod.spec | 9 +++++++--
4 files changed, 35 insertions(+), 13 deletions(-)
---
diff --git a/gcc-14.patch b/gcc-14.patch
new file mode 100644
index 0000000..2d5a4e4
--- /dev/null
+++ b/gcc-14.patch
@@ -0,0 +1,13 @@
+diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh 2024-04-08 20:42:51.187823000 +0200
++++ b/kernel/conftest.sh 2024-04-09 21:37:15.674481821 +0200
+@@ -158,7 +158,8 @@
+ build_cflags() {
+ BASE_CFLAGS="-O2 -D__KERNEL__ \
+ -DKBUILD_BASENAME=\"#conftest$$\" -DKBUILD_MODNAME=\"#conftest$$\"
\
+--nostdinc -isystem $ISYSTEM"
++-nostdinc -isystem $ISYSTEM \
++-Wno-implicit-function-declaration -Wno-strict-prototypes"
+
+ if [ "$OUTPUT" != "$SOURCES" ]; then
+ OUTPUT_CFLAGS="-I$OUTPUT/include2 -I$OUTPUT/include"
diff --git a/kernel-6.8.2.patch b/kernel-6.8.2.patch
new file mode 100644
index 0000000..3adcfc0
--- /dev/null
+++ b/kernel-6.8.2.patch
@@ -0,0 +1,15 @@
+diff -Naur a/kernel/conftest.sh b/kernel/conftest.sh
+--- a/kernel/conftest.sh 2024-04-08 20:36:36.730198000 +0200
++++ b/kernel/conftest.sh 2024-04-08 20:35:11.117112000 +0200
+@@ -1862,7 +1862,11 @@
+ #error DRM not enabled
+ #endif
+
++ #include <linux/bug.h>
++ #include <linux/version.h>
++
+ void conftest_drm_available(void) {
++ BUILD_BUG_ON(LINUX_VERSION_CODE >= KERNEL_VERSION(6, 8, 0));
+ struct drm_driver drv;
+
+ /* 2013-10-02 1bb72532ac260a2d3982b40bdd4c936d779d0d16 */
diff --git a/nvidia-340xx-kmod.spec b/nvidia-340xx-kmod.spec
index 80eb899..a870458 100644
--- a/nvidia-340xx-kmod.spec
+++ b/nvidia-340xx-kmod.spec
@@ -12,7 +12,7 @@ Name: nvidia-340xx-kmod
Epoch: 1
Version: 340.108
# Taken over by kmodtool
-Release: 30%{?dist}
+Release: 31%{?dist}
Summary: NVIDIA display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -24,7 +24,8 @@ Patch1: fix-build-issues.patch
Patch2: kernel-6.3.1.patch
Patch3: kernel-6.5.2.patch
Patch4: kernel-6.6.1.patch
-Patch5: kernel-6.6.8.patch
+Patch5: kernel-6.8.2.patch
+Patch6: gcc-14.patch
BuildRequires: elfutils-libelf-devel
BuildRequires: gcc
@@ -57,6 +58,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
%patch 3 -p1
%patch 4 -p1
%patch 5 -p1
+%patch 6 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -85,6 +87,9 @@ done
%{?akmod_install}
%changelog
+* Tue Apr 09 2024 Łukasz Wojniłowicz <lukasz.wojnilowicz(a)gmail.com> - 1:340.108-31
+- Fix build on gcc-14
+
* Fri Mar 29 2024 Łukasz Wojniłowicz <lukasz.wojnilowicz(a)gmail.com> - 1:340.108-30
- Fix build on kernel-6.8.2