Building nvidia-drivers against a clang-built kernel fails with clang-15: --------8<--------------------------------------------------------- /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.c:1091:36: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] NvU32 NV_API_CALL os_get_cpu_number() ^ void /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.c:1098:35: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] NvU32 NV_API_CALL os_get_cpu_count() ^ void /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.c:1151:31: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] void NV_API_CALL os_dump_stack() ^ void /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.c:1291:11: warning: format string is not a string literal (potentially insecure) [-Wformat-security] panic(bugCodeStr); ^~~~~~~~~~ /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.c:1291:11: note: treat the string as an argument to avoid this panic(bugCodeStr); ^ "%s", 1 warning and 3 errors generated. make[2]: *** [scripts/Makefile.build:249: /var/tmp/portage/x11-drivers/nvidia-drivers-515.65.01/work/kernel/nvidia/os-interface.o] Error 1 --------8<--------------------------------------------------------- This is most likely caused by one of the controversially discussed changes in clang-15 turning several warnings into errors, in this case -Wstrict-prototypes. My setup works fine with clang-14. Reproducible: Always Steps to Reproduce: 1. Build kernel with Clang-15 (CC=clang LLVM=1 LLVM_IAS=1) 2. Try to build nvidia-drivers with system-wide Clang-15 3. Profit Actual Results: Cmopilation fails Expected Results: Compilation should not fail
Created attachment 805357 [details] build.log
Created attachment 805360 [details] emerge --info
One more note: This was already using clang-15.0.1, i.e. including the emergency fixes for some of the other warnings, but that doesn't apparently cover -Wstrict-prototypes.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1b84c5ad27be16032ac596f0cad88869b3c1741 commit e1b84c5ad27be16032ac596f0cad88869b3c1741 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2022-09-16 05:14:10 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2022-09-16 06:05:35 +0000 x11-drivers/nvidia-drivers: fix building modules with clang15 Closes: https://bugs.gentoo.org/870238 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> .../files/nvidia-drivers-390.154-clang15.patch | 81 ++++++++++++++++ .../files/nvidia-drivers-470.141.03-clang15.patch | 107 +++++++++++++++++++++ .../nvidia-drivers/nvidia-drivers-390.154.ebuild | 1 + .../nvidia-drivers-470.141.03.ebuild | 1 + .../nvidia-drivers/nvidia-drivers-510.85.02.ebuild | 1 + .../nvidia-drivers/nvidia-drivers-515.49.15.ebuild | 4 + .../nvidia-drivers/nvidia-drivers-515.65.01.ebuild | 4 + 7 files changed, 199 insertions(+)