Unverified Commit 5f340ac7 authored by K900's avatar K900 Committed by GitHub
Browse files

mesa: fix build for musl (#463575)

parents 396540d0 cbe06832
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -150,6 +150,7 @@ stdenv.mkDerivation {

  patches = [
    ./opencl.patch
    ./musl.patch
  ];

  postPatch = ''
+39 −0
Original line number Diff line number Diff line
From 571dedac8881649cd94c59488413b835cbcf0498 Mon Sep 17 00:00:00 2001
From: Alyssa Ross <hi@alyssa.is>
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 <hi@alyssa.is>
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