Problem with statics of SDL & SDL mixer

I don’t know what happened, or if the problem is in my code, but since I
upgraded SDL2 and SDL2_mixer to the TIP of HG my iOS apps stop working with
some strange error in Mix_OpenAudio call.

I debugged it and saw that the static variable “audio_opened” in mixer.c
has a huge value instead of the “0” that it should have since it’s
initialized with something like:

static int audio_opened = 0;

… i tried to fix this by hand (audio_opened = 0; in the beginning of
Mix_OpenAudio), but I saw that ALL the static variables of SDL mixer were
messed up.

Every pointer was not NULL, every counter had a random value.

So I thought the problem was in the HG versions and switched to SDL 2.0.3
and SDL2_Mixer 2.0.0, I got the archives from, and compiled
without changes to the projects with XCode5 and iOS 7.1 SDK, and added back
the resulting libSDL.a and libSDL2_mixer.a to my project.

The result was the same, static variables do not have their initial value
correctly initialized.

So I thought the problem was in xcode5 and I tried to compile in a lion
machine with xcode4 with the same result…

This happens both with “simulator” builds and “device” builds…

I tried to look in compiler settings if something strange was going on but
I cannot find the problem, and also googling for an answer gave me no
interesting results…–