diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix index 59e68c60de96..31b284c3cc49 100644 --- a/pkgs/development/libraries/mesa/default.nix +++ b/pkgs/development/libraries/mesa/default.nix @@ -150,6 +150,7 @@ stdenv.mkDerivation { patches = [ ./opencl.patch + ./musl.patch ]; postPatch = '' diff --git a/pkgs/development/libraries/mesa/musl.patch b/pkgs/development/libraries/mesa/musl.patch new file mode 100644 index 000000000000..07f6c9c41463 --- /dev/null +++ b/pkgs/development/libraries/mesa/musl.patch @@ -0,0 +1,39 @@ +From 571dedac8881649cd94c59488413b835cbcf0498 Mon Sep 17 00:00:00 2001 +From: Alyssa Ross +Date: Thu, 20 Nov 2025 23:16:47 +0100 +Subject: [PATCH] rocket: fix building for musl + +musl follows POSIX and provides ioctl as int ioctl(int, int, ...). + +Fixes: 5b829658f74 ("rocket: Initial commit of a driver for Rockchip's NPU") +Signed-off-by: Alyssa Ross +Link: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38561 +--- + src/gallium/drivers/rocket/intercept.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/src/gallium/drivers/rocket/intercept.c b/src/gallium/drivers/rocket/intercept.c +index 6ffb8647d61f5..88e55893d9520 100644 +--- a/src/gallium/drivers/rocket/intercept.c ++++ b/src/gallium/drivers/rocket/intercept.c +@@ -294,9 +294,15 @@ handle_action(struct rknpu_action *args) + } + } + +-typedef int (*real_ioctl_t)(int fd, unsigned long request, ...); ++#ifdef __GLIBC__ ++typedef unsigned long ioctl_req; ++#else ++typedef int ioctl_req; // per POSIX ++#endif ++ ++typedef int (*real_ioctl_t)(int fd, ioctl_req request, ...); + int +-ioctl(int fd, unsigned long request, ...) ++ioctl(int fd, ioctl_req request, ...) + { + int ret; + uint32_t output_address = 0; +-- +GitLab +