[Buildroot] [PATCH v6 1/6] package/sdl3: fix build on PowerPC with uClibc
Dario Binacchi <[email protected]>
| Newsgroups | net.busybox.buildroot |
|---|---|
| Message-ID | <[email protected]> |
Testing the SDL3 package by running:
$ utils/test-pkg -p sdl3 -T bootlin-powerpc-e500mc-uclibc
raised the following error:
src/cpuinfo/SDL_cpuinfo.c: In function 'SDL_GetAltiVecFeatures':
src/cpuinfo/SDL_cpuinfo.c:351:37: error: 'PPC_FEATURE_HAS_ALTIVEC' undeclared (first use in this function)
351 | altivec = getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC;
| ^~~~~~~~~~~~~~~~~~~~~~~
Add a patch providing a fallback definition for PPC_FEATURE_HAS_ALTIVEC.
Fixes: 2dd13e328f11 ("package/sdl3: new package")
Signed-off-by: Dario Binacchi <[email protected]>
---
...001-Fix-build-on-PowerPC-with-uClibc.patch | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)
create mode 100644 package/sdl3/0001-Fix-build-on-PowerPC-with-uClibc.patch
diff --git a/package/sdl3/0001-Fix-build-on-PowerPC-with-uClibc.patch b/package/sdl3/0001-Fix-build-on-PowerPC-with-uClibc.patch
new file mode 100644
index 000000000000..17197478682d
--- /dev/null
+++ b/package/sdl3/0001-Fix-build-on-PowerPC-with-uClibc.patch
@@ -0,0 +1,40 @@
+From e9f373ffed24781bc09a1c20d0c58c809a5c7838 Mon Sep 17 00:00:00 2001
+From: Dario Binacchi <[email protected]>
+Date: Sun, 23 Aug 2026 16:09:24 +0200
+Subject: [PATCH] Fix build on PowerPC with uClibc
+
+PPC_FEATURE_HAS_ALTIVEC is not defined by all C libraries. The following
+error was raised while testing SDL3 in Buildroot with a PowerPC toolchain
+using uClibc-ng:
+
+ src/cpuinfo/SDL_cpuinfo.c: In function 'SDL_GetAltiVecFeatures':
+ src/cpuinfo/SDL_cpuinfo.c:351:37: error: 'PPC_FEATURE_HAS_ALTIVEC' undeclared (first use in this function)
+ 351 | altivec = getauxval(AT_HWCAP) & PPC_FEATURE_HAS_ALTIVEC;
+ | ^~~~~~~~~~~~~~~~~~~~~~~
+
+Provide a fallback definition when it is not defined.
+
+Signed-off-by: Dario Binacchi <[email protected]>
+Upstream: https://github.com/libsdl-org/SDL/pull/16184
+---
+ src/cpuinfo/SDL_cpuinfo.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
+index 116c5371c1ed..d58c1503179a 100644
+--- a/src/cpuinfo/SDL_cpuinfo.c
++++ b/src/cpuinfo/SDL_cpuinfo.c
+@@ -80,6 +80,10 @@
+ #include <sys/auxv.h>
+ #endif
+
++#ifndef PPC_FEATURE_HAS_ALTIVEC
++#define PPC_FEATURE_HAS_ALTIVEC 0x10000000
++#endif
++
+ #ifdef SDL_PLATFORM_RISCOS
+ #include <kernel.h>
+ #include <swis.h>
+--
+2.43.0
+
--
2.43.0
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot