diff --git a/srcpkgs/incus/patches/afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf.patch b/srcpkgs/incus/patches/afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf.patch new file mode 100644 index 00000000000000..387ee3f21c8862 --- /dev/null +++ b/srcpkgs/incus/patches/afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf.patch @@ -0,0 +1,33 @@ +From afa91aaa5d0f7c95a69a17428e1974ebbf34ecdf Mon Sep 17 00:00:00 2001 +From: Christian Brauner +Date: Tue, 19 Nov 2024 15:42:18 +0100 +Subject: [PATCH] cgo/process_utils: fix 32bit builds + +New clang-14 reports errors for directly casting from an integer to a +pointer. Use uintptr_t to fix that problem and adhere to the casting +rules. + +Fixes: https://github.com/lxc/incus/issues/1395 +Signed-off-by: Christian Brauner +--- + shared/cgo/process_utils.h | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/shared/cgo/process_utils.h b/shared/cgo/process_utils.h +index 3e1c400c539..19443e921fa 100644 +--- a/shared/cgo/process_utils.h ++++ b/shared/cgo/process_utils.h +@@ -219,9 +219,11 @@ static inline int setproctitle(char *title) + ret = prctl(PR_SET_MM, prctl_arg(PR_SET_MM_MAP), prctl_arg(&prctl_map), + prctl_arg(sizeof(prctl_map)), prctl_arg(0)); + if (ret == 0) { +- char *dest = (char *)arg_start; ++ char *dest; ++ ++ dest = (char *)(uintptr_t)arg_start; + memcpy(dest, title, len - 1); +- dest[len-1] = '\0'; ++ dest[len - 1] = '\0'; + } + + return ret;