It seems the length of the hash generated by
`git rev-parse --short HEAD` is nondeterministic. GitHub Actions
generates 7-character hashes, while my computer currently generates
8-character hashes. To be consistent, I'm forcing the hashes to be 7
characters long.
This way Meson will automatically keep the Git hash updated as you make
new Git commits, rather than forcing you to reconfigure the build again
every time you make a new commit to keep the commit hash updated.
(cherry picked from commit b9bb3535ae)
This removes the need to have xxd installed and provides a portable way
to specify the name of the output array (xxd has an `-n` option for
this, but it isn't present in older versions of xxd), which helps reduce
the possibility of symbol conflicts in libretro builds and also prevents
portability issues since the name of xxd's output array depends on the
relative path to the input file, which can break if Meson changes the
structure of the build directory or if the user sets the build directory
to a different location.
Also, this custom executable declares the array as const so that it goes
into the read-only data section of the binary instead of the data
section.
According to AddressSanitizer, when `sandbox_malloc` causes the
WebAssembly memory to grow in size, every single coroutine on the
sandbox stack gets corrupted. So if `sandbox_malloc` is going to cause
the memory to grow in size, we need to yield so that there are no
coroutines on the sandbox stack while the reallocation occurs.
The Emscripten build doesn't support stack protection. Besides, if we
really wanted to enable fortification and stack protection, we would
enable it for the entire application instead of enabling it for only
these two libraries.
Now it actually stops the audio instead of doing nothing.
Also, calling `Audio.bgm_stop` was causing a crash in Emscripten due to
an exception being thrown internally in OpenAL Soft and C++ exceptions
being disabled when targeting Emscripten. Shouldn't happen anymore.
This way Meson will automatically keep the Git hash updated as you make
new Git commits, rather than forcing you to reconfigure the build again
every time you make a new commit to keep the commit hash updated.