summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-01-15 17:28:24 -0500
committerIonen Wolkens <ionen@gentoo.org>2024-01-15 18:00:44 -0500
commit9b89609eb1e84c5f5077039c7ff1d7865a81f85f (patch)
tree4e513e3d9c309dce3212693801bda163e1837b4e /x11-drivers
parentdev-qt/qtwebengine: add 5.15.12_p20240112 (diff)
downloadgentoo-9b89609eb1e84c5f5077039c7ff1d7865a81f85f.tar.gz
gentoo-9b89609eb1e84c5f5077039c7ff1d7865a81f85f.tar.bz2
gentoo-9b89609eb1e84c5f5077039c7ff1d7865a81f85f.zip
x11-drivers/nvidia-drivers: fix build with upcoming gcc14
Trivial and proper fix for 5xx branches, NVIDIA seems to be (now) keeping track of implicits and incompatibles beside missing this one hidden behind 2>/dev/null and kernel >=5.18. Can't say the same for the legacy branches (390 and 470), and rather than worry about these going for the lame life support treatment with -Wno-error= there. 470 has hope to be fixed properly by NVIDIA still but this is likely there forever in the not supported + masked 390. No need for revbumps, with gcc13 the test simply functions properly and does what's right, while with 14 it's just a build-time issue (and legacy branches are unchanged). Closes: https://bugs.gentoo.org/921370 Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-drivers')
-rw-r--r--x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch32
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild11
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild13
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild1
-rw-r--r--x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild1
7 files changed, 60 insertions, 0 deletions
diff --git a/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch
new file mode 100644
index 000000000000..799f80b79f7e
--- /dev/null
+++ b/x11-drivers/nvidia-drivers/files/nvidia-drivers-525.147.05-gcc14.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/921370
+https://forums.developer.nvidia.com/t/279072
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -4807,6 +4807,11 @@
+ CODE="
+ #include <drm/drm_gem.h>
++ #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++ typedef struct iosys_map nv_sysio_map_t;
++ #else
++ typedef struct dma_buf_map nv_sysio_map_t;
++ #endif
+ int conftest_drm_gem_object_vmap_has_map_arg(
+- struct drm_gem_object *obj, struct dma_buf_map *map) {
++ struct drm_gem_object *obj, nv_sysio_map_t *map) {
+ return obj->funcs->vmap(obj, map);
+ }"
+--- a/kernel-module-source/kernel-open/conftest.sh
++++ b/kernel-module-source/kernel-open/conftest.sh
+@@ -4807,6 +4807,11 @@
+ CODE="
+ #include <drm/drm_gem.h>
++ #if defined(NV_LINUX_IOSYS_MAP_H_PRESENT)
++ typedef struct iosys_map nv_sysio_map_t;
++ #else
++ typedef struct dma_buf_map nv_sysio_map_t;
++ #endif
+ int conftest_drm_gem_object_vmap_has_map_arg(
+- struct drm_gem_object *obj, struct dma_buf_map *map) {
++ struct drm_gem_object *obj, nv_sysio_map_t *map) {
+ return obj->funcs->vmap(obj, map);
+ }"
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
index e722d7730c3d..364d03fab92d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-390.157.ebuild
@@ -151,6 +151,16 @@ src_compile() {
tc-export AR CC CXX LD OBJCOPY OBJDUMP
local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+ # latest branches has proper fixes, but legacy have more issues and are
+ # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370)
+ local noerr=(
+ -Wno-error=implicit-function-declaration
+ -Wno-error=incompatible-pointer-types
+ )
+ # not *FLAGS to ensure it's used everywhere including conftest.sh
+ CC+=" $(test-flags-CC "${noerr[@]}")"
+ use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${noerr[@]}")"
+
NV_ARGS=(
PREFIX="${EPREFIX}"/usr
HOST_CC="$(tc-getBUILD_CC)"
@@ -162,6 +172,7 @@ src_compile() {
local modlist=( nvidia{,-drm,-modeset}=video:kernel )
use x86 || modlist+=( nvidia-uvm=video:kernel )
local modargs=(
+ CC="${KERNEL_CC}" # for the above gcc14 workarounds
IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
)
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
index d9f0ac99c1b1..a81c071f8b6d 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-470.223.02.ebuild
@@ -148,6 +148,18 @@ src_compile() {
tc-export AR CC CXX LD OBJCOPY OBJDUMP
local -x RAW_LDFLAGS="$(get_abi_LDFLAGS) $(raw-ldflags)" # raw-ldflags.patch
+ # latest branches has proper fixes, but legacy have more issues and are
+ # not worth the trouble, so doing the lame "fix" for gcc14 (bug #921370)
+ # TODO: check if still needed on bumps given this branch is supported,
+ # and reminder to cleanup the CC="${KERNEL_CC}" in modargs if removing
+ local noerr=(
+ -Wno-error=implicit-function-declaration
+ -Wno-error=incompatible-pointer-types
+ )
+ # not *FLAGS to ensure it's used everywhere including conftest.sh
+ CC+=" $(test-flags-CC "${noerr[@]}")"
+ use modules && KERNEL_CC+=" $(CC=${KERNEL_CC} test-flags-CC "${noerr[@]}")"
+
local xnvflags=-fPIC #840389
# lto static libraries tend to cause problems without fat objects
is-flagq '-flto@(|=*)' && xnvflags+=" $(test-flags-CC -ffat-lto-objects)"
@@ -163,6 +175,7 @@ src_compile() {
local modlist=( nvidia{,-drm,-modeset,-peermem,-uvm}=video:kernel )
local modargs=(
+ CC="${KERNEL_CC}" # for the above gcc14 workarounds
IGNORE_CC_MISMATCH=yes NV_VERBOSE=1
SYSOUT="${KV_OUT_DIR}" SYSSRC="${KV_DIR}"
)
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
index bf6ccdee2c2e..8198376cd815 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-525.147.05.ebuild
@@ -88,6 +88,7 @@ QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
"${FILESDIR}"/nvidia-drivers-525.116.04-clang-unused-option.patch
+ "${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-390.144-desktop.patch
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
index 3f1e1c192353..9097157c2346 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.146.02.ebuild
@@ -88,6 +88,7 @@ BDEPEND="
QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
+ "${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
index 8c94a78cb103..1c4a52826bb9 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-535.43.22.ebuild
@@ -91,6 +91,7 @@ BDEPEND="
QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
+ "${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
"${FILESDIR}"/nvidia-kernel-module-source-515.86.01-raw-ldflags.patch
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-390.144-raw-ldflags.patch
diff --git a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
index 635d62b67243..8150845d19c5 100644
--- a/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
+++ b/x11-drivers/nvidia-drivers/nvidia-drivers-545.29.06-r1.ebuild
@@ -87,6 +87,7 @@ BDEPEND="
QA_PREBUILT="lib/firmware/* opt/bin/* usr/lib*"
PATCHES=(
+ "${FILESDIR}"/nvidia-drivers-525.147.05-gcc14.patch
"${FILESDIR}"/nvidia-modprobe-390.141-uvm-perms.patch
"${FILESDIR}"/nvidia-settings-530.30.02-desktop.patch
)