Dmitry Osipenko <[email protected]> writes:
> On 3/4/26 11:49, Alex Bennée wrote:
>> Dmitry Osipenko <[email protected]> writes:
>>
>>> From: Pierre-Eric Pelloux-Prayer <[email protected]>
>>>
<snip>
>>> @@ -120,6 +124,9 @@ void sdl2_window_create(struct sdl2_console *scon)
>>> /* The SDL renderer is only used by sdl2-2D, when OpenGL is
>>> disabled */
>>> scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
>>> }
>>> +
>>> + qemu_egl_display = eglGetCurrentDisplay();
>>> +
>>
>> This fails on MacOS for some reason:
>>
>> o libsystem.a.p/ui_sdl2.c.o -c ../ui/sdl2.c
>> ../ui/sdl2.c:128:5: error: use of undeclared identifier 'qemu_egl_display'
>> 128 | qemu_egl_display = eglGetCurrentDisplay();
>> | ^
>> ../ui/sdl2.c:128:24: error: call to undeclared function
>> 'eglGetCurrentDisplay'; ISO C99 and later do not support implicit function
>> declarations [-Wimplicit-function-declaration]
>> 128 | qemu_egl_display = eglGetCurrentDisplay();
>> | ^
>> 2 errors generated.
>>
>> See: https://gitlab.com/stsquad/qemu/-/jobs/13340079105
>>
>> Not sure what the include differences are because --enable-sdl builds
>> fine on Linux.
>
> Please try with this change and let me know if you could squash it or I
> need to send a patch:
>
> diff --git a/ui/sdl2.c b/ui/sdl2.c
> index 3bb2676f847b..2603b0c2bdd8 100644
> --- a/ui/sdl2.c
> +++ b/ui/sdl2.c
> @@ -125,7 +125,9 @@ void sdl2_window_create(struct sdl2_console *scon)
> scon->real_renderer = SDL_CreateRenderer(scon->real_window, -1, 0);
> }
>
> +#ifdef CONFIG_OPENGL
> qemu_egl_display = eglGetCurrentDisplay();
> +#endif
>
> sdl_update_caption(scon);
> }
heh, I had got to something similar but then ran into a link failure at
the end:
Undefined symbols for architecture arm64:
"_sdl2_gl_console_init", referenced from:
_sdl2_display_init in ui_sdl2.c.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.
make: *** [run-ninja] Error 1
--
Alex Bennée
Virtualisation Tech Lead @ Linaro