We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4644

Summary: SDL_CreateWindow fails on systems without X11, if libEGL.so is not linked manually or preloaded
Product: SDL Reporter: Danilo Spinella <danyspin97>
Component: loadsoAssignee: Sam Lantinga <slouken>
Status: NEW --- QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.9   
Hardware: x86_64   
OS: Linux   

Description Danilo Spinella 2019-05-26 21:18:11 UTC
In a configuration with OpenGL ES v1/v2 and EGL enabled, a program linked with -lSDL2 fails to create a window.

I've also tested the bug against this simple application:
https://wiki.libsdl.org/SDL_GetWindowSurface


SDL_Error() report: "failed to create a window surface".

If I link the application with EGL ("-lEGL") it works flawlessy, the same if I use LD_PRELOAD=/usr/lib/libEGL.so.

Running a strace of the application, it loads /usr/lib/wayland-egl.so when it is isn't compiled with "-lEGL".
Comment 1 Danilo Spinella 2019-05-26 21:27:44 UTC
As an additional note, I am running a musl based system. It doens't seem to be related though.