[Buildroot] [PATCH v6 2/6] package/sdl3: disable m68k builds

Dario Binacchi <[email protected]>
Newsgroups net.busybox.buildroot
Message-ID <[email protected]>
SDL_alignment_test has a static assertion to ensure that its size is
2 * sizeof(void *), as SDL relies on this layout for its ABI.

Testing the SDL3 package by running:

  $ utils/test-pkg -p sdl3 -T bootlin-m68k-68040-uclibc

raised the following error:

  In file included from src/libm/k_sin.c:1:
  include/SDL3/SDL_stdinc.h:230:42: error: static assertion failed: "sizeof(SDL_alignment_test) == (2 * sizeof(void *))"
    230 | #define SDL_COMPILE_TIME_ASSERT(name, x) _Static_assert(x, #x)
        |                                          ^~~~~~~~~~~~~~
  include/SDL3/SDL_stdinc.h:1187:1: note: in expansion of macro 'SDL_COMPILE_TIME_ASSERT'
   1187 | SDL_COMPILE_TIME_ASSERT(struct_alignment, sizeof(SDL_alignment_test) == (2 * sizeof(void *)));

Since the m68k ABI results in a different structure size, disable m68k
builds.

Fixes: 2dd13e328f11 ("package/sdl3: new package")
Signed-off-by: Dario Binacchi <[email protected]>
---
 package/sdl3/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/package/sdl3/Config.in b/package/sdl3/Config.in
index 7bce4ceaba9c..f5ba8b6a016b 100644
--- a/package/sdl3/Config.in
+++ b/package/sdl3/Config.in
@@ -1,5 +1,12 @@
+config BR2_PACKAGE_SDL3_ARCH_SUPPORTS
+	bool
+	default y
+	# Invalid size of the SDL_alignment_test struct on m68k
+	depends on !BR2_m68k
+
 config BR2_PACKAGE_SDL3
 	bool "sdl3"
+	depends on BR2_PACKAGE_SDL3_ARCH_SUPPORTS
 	depends on !BR2_STATIC_LIBS
 	depends on BR2_USE_WCHAR
 	depends on BR2_TOOLCHAIN_HAS_THREADS
@@ -78,4 +85,5 @@ comment "OpenGL ES support needs an OpenGL ES provider"
 endif
 
 comment "sdl3 needs a toolchain w/ dynamic library, threads, wchar"
+	depends on BR2_PACKAGE_SDL3_ARCH_SUPPORTS
 	depends on BR2_STATIC_LIBS || !BR2_TOOLCHAIN_HAS_THREADS || !BR2_USE_WCHAR
-- 
2.43.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.