SDL 2.x recently accepted patches to enable OpenGL ES 2 support via Google's ANGLE library. The thought is to try to eventually merge SDL/WinRT's OpenGL code with SDL-official's.
It was very confusing to have configure generate an SDL_config.h and then not have it be used when building on Mac OS X or Windows. I'll just have to remember to use SDL_config_windows.h when building official releases that are supposed to be ABI compatible with Visual Studio.
--HG--
rename : include/SDL_config_generated.h.in => include/SDL_config.h.in
t.grundner@goto3d.de 2011-09-01 03:59:17 PDT
I figured out what is going on. GCC 4.5.2 assumes the stack is 16 byte aligned
by default. Therefore there are no AND alignment corrections necessary if we
wish to align a stack variable to a 16 byte boundary. That is bad if your OS
ABI is not 16 byte aligned. Windows 32 bit stacks are 4 byte aligned. This
results in the above mentioned SIGSEGV. This is also no problem if I compile
both SDL.dll and my app with MingW because MinGW/GCC inserts a
andl $-16, %esp
instruction right in the beginning of the main function. So at least the stack
of the thread calling the main function is 16 byte aligned. But as soon as I
start to use the SDL.dll from an application not compiled by MinGW there is no
ANDL safing my app.
However there is a GCC option that can change the default stack alignment:
-mpreferred-stack-boundary=num
Setting num=2 assumes a the stack is aligned to a 4 byte boundary. This results
in GCC inserting the necessary
andl $-16, %esp
into SDL_FillRect. Rebuilding SDL with
./configure "CFLAGS=-mpreferred-stack-boundary=2 -g -O3"
solved the problem.
IMHO this should also be a problem on Solaris.
The following links contain further information:
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Optionshttp://www.agner.org/optimize/calling_conventions.pdf
The trick is that if you're using configure and you don't want to have SDL_config.h and SDL_revision.h to show up as modified, you need to configure and build from a separate directory.
You also need to include SDL_revision.h directly if you want to use the SDL_REVISION constant, as a side effect of these changes.
--HG--
rename : include/SDL_config.h.default => include/SDL_config.h
SDL_config.h is no longer in CVS. Instead, configure will generate it for
systems that use configure, and we always copy SDL_config.h.default to
SDL_config.h before generating a snapshot or release archive.
Also fixed a couple of uninstall issues.
--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401610