[v7,1/5] package/sdl3: disable m68k builds

Message ID 20261125161404.859000-2-dario.binacchi@amarulasolutions.com
State New
Headers
Series package: add CANopenterm and dependencies |

Commit Message

Dario Binacchi Nov. 25, 2026, 4:14 p.m. UTC
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 <dario.binacchi@amarulasolutions.com>
---
 package/sdl3/Config.in | 8 ++++++++
 1 file changed, 8 insertions(+)

-- 
2.43.0
  

Comments

Dario Binacchi Nov. 25, 2026, 4:22 p.m. UTC | #1
Hi Michael,

adding you in Cc as the sdl3 maintainer in DEVELOPERS, I missed you
when sending the series. This patch disables sdl3 on m68k.

Thanks and regards,
Dario

On Wed, Nov 25, 2026 at 5:14 PM Dario Binacchi
<dario.binacchi@amarulasolutions.com> wrote:
>
> 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 <dario.binacchi@amarulasolutions.com>
> ---
>  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
>


-- 
Dario Binacchi
Senior Embedded Software Engineer
M. +39 328 0625246
dario.binacchi@amarulasolutions.com
―――――――――――――――
Amarula Solutions SRL
 Via Felice Cavallotti 25D, 41012 Carpi, MO, IT
info@amarulasolutions.com
www.amarulasolutions.com
  
Julien Olivain Nov. 25, 2026, 8:29 p.m. UTC | #2
On 25/11/2026 17:14, Dario Binacchi wrote:
> 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 <dario.binacchi@amarulasolutions.com>

Series applied to next, thanks.
  

Patch

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