[PATCH i-g-t 3/3] lib/svga/vm_basic_types: fix musl libs compilation

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu Jul 10 19:00:12 UTC 2025


Fix gcc compilation on Void Linux with musl C libs, where
PAGE_SIZE is already defined.

Reported-by: zlice <zlice555 at gmail.com>
Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/179
Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
 lib/svga/vm_basic_types.h | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lib/svga/vm_basic_types.h b/lib/svga/vm_basic_types.h
index 8fec5b665..ea10a683c 100644
--- a/lib/svga/vm_basic_types.h
+++ b/lib/svga/vm_basic_types.h
@@ -27,7 +27,15 @@
 #define VM_BASIC_TYPES_H
 
 #define PAGE_SHIFT 12
-#define PAGE_SIZE (1 << PAGE_SHIFT)
+
+#ifndef PAGE_SIZE
+# define PAGE_SIZE (1 << PAGE_SHIFT)
+#else
+# if PAGE_SIZE != 4096
+#  error "Unexpected PAGE_SIZE"
+# endif
+#endif
+
 #define PAGE_MASK (~(PAGE_SIZE - 1))
 #define PAGE_ALIGN(addr) (((addr) + PAGE_SIZE - 1) & PAGE_MASK)
 
-- 
2.50.1



More information about the igt-dev mailing list