NVIDIA – GCC 14 Breaks Compile – and Fix.. (VMware OK..)
Testing Fedora 40, which now includes GCC 14, and this breaks the NVIDIA driver 550.54.14 compile:
…………………..
CC [M] /home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-connector.o
CC [M] /home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.o
/home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.c:115:16: error: initialization of ‘int (*)(struct drm_gem_object *, struct iosys_map *)’ from incompatible pointer type ‘void * (*)(struct drm_gem_object *)’ [-Wincompatible-pointer-types]
115 | .vmap = nv_drm_gem_prime_vmap,
| ^~~~~~~~~~~~~~~~~~~~~
/home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.c:115:16: note: (near initialization for ‘nv_drm_gem_funcs.vmap’)
/home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.c:116:16: error: initialization of ‘void (*)(struct drm_gem_object *, struct iosys_map *)’ from incompatible pointer type ‘void (*)(struct drm_gem_object *, void *)’ [-Wincompatible-pointer-types]
116 | .vunmap = nv_drm_gem_prime_vunmap,
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.c:116:16: note: (near initialization for ‘nv_drm_gem_funcs.vunmap’)
make[3]: *** [scripts/Makefile.build:243: /home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel/nvidia-drm/nvidia-drm-gem.o] Error 1
make[2]: *** [/usr/src/linux-6.7.8/Makefile:1911: /home/rgadsdon/NVIDIA-Linux-x86_64-550.54.14/kernel] Error 2
make[1]: *** [Makefile:234: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-6.7.8'
make: *** [Makefile:85: modules] Error 2
Fortunately, there is already a fix/workaround for this, and details can be found on the NVIDIA Forum, at https://forums.developer.nvidia.com/t/nvidia-modules-build-failure-with-upcoming-gcc-14-and-recent-kernels-due-to-misfiring-conftest-sh-test-heads-up/279072
I have successfully applied this to 550.54.14 (with some fuzz..), and it now compiles and runs OK.. Thanks to ionen on the forum for providing this…. Hopefully, NVIDIA will release a driver version that addresses this..
It is worth mentioning that the latest VMware 17.5.1 patchset is OK with GCC 14… at https://github.com/mkubecek/vmware-host-modules/tree/workstation-17.5.1
Robert Gadsdon. March 6th 2024.
Comments
NVIDIA – GCC 14 Breaks Compile – and Fix.. (VMware OK..) — No Comments