Is it impossible to build a binary that runs on Raspbian Jessie and Stretch?

I’m statically linking against libSDL and the following post has caught my attention:
http://choccyhobnob.com/raspberry-pi/sdl2-2-0-6-on-raspberry-pi/

The author says that SDL uses hardcoded paths for the Raspi graphics drivers and those paths don’t exist any longer on Stretch. Precisely, the author claims that these lines

#if SDL_VIDEO_DRIVER_RPI
/* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
#define DEFAULT_EGL “/opt/vc/lib/libEGL.so”
#define DEFAULT_OGL_ES2 “/opt/vc/lib/libGLESv2.so”
#define DEFAULT_OGL_ES_PVR “/opt/vc/lib/libGLES_CM.so”
#define DEFAULT_OGL_ES "/opt/vc/lib/libGLESv1_CM.so

have to be changed into these:

#if SDL_VIDEO_DRIVER_RPI
/* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
#define DEFAULT_EGL “/opt/vc/lib/libbrcmEGL.so”
#define DEFAULT_OGL_ES2 “/opt/vc/lib/libbrcmGLESv2.so”
#define DEFAULT_OGL_ES_PVR “/opt/vc/lib/libbrcmGLESv2.so”
#define DEFAULT_OGL_ES “/opt/vc/lib/libbrcmGLESv2.so”

So is it impossible to build a binary which works on both Jessie and Stretch? This would be very disappointing… I mean, SDL 2.0.6 is brand new… why doesn’t it take care of it and automatically uses the right paths in case the user is running Stretch?

Unfortunately, I’m still running Jessie here so I can’t test it on Stretch but according to the author of the blog I quoted above, it won’t work on Stretch because of the hardcoded paths… this is somewhat confusing. Can anybody shed some light onto this?

Just another info: I want to use static linking. So any solution that says “just link dynamically” isn’t good for me :slight_smile:

I noticed this as well. This change was known for a year and nobody cared to put a simple report on the SDL bug tracker about this.

It was partially fixed with this recent commit:

I think it doesn’t yet take care of the OpenGL ES 1 library which must be accessed through libbrcmGLESv2.so. In the meantime, there’s always environment variables.

SDL_VIDEO_EGL_DRIVER=/opt/vc/lib/libbrcmEGL.so
SDL_VIDEO_GL_DRIVER=/opt/vc/lib/libbrcmGLESv2.so

Edit: Oh, I forgot. Jessie also has the brcm versions.

Ok, thanks for the pointer. I’m now using the latest SDL master which has this fix instead of the 2.0.6 release candidate. It works fine on Jessie and I hope it doesn’t fail on Stretch but I can’t test this.