mirror of https://github.com/encounter/SDL.git
e4411505ab
This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. The referential safety is enforced through the use of tagged memory, and there is only a single tag bit per capability-sized word, meaning it is impossible to store capabilities at unaligned locations, either getting a trap on load/store or the validity tag being stripped when round-tripepd through memory. Since this is a new ABI for which SDL has never been compiled before, we do not need to be concerned with this compatibility measure, so just don't pack the struct for CHERI architectures. This code is inherently rather dubious anyway; if MSVC and GCC disagree on struct layout when targeting Windows then that is a bug in GCC, but likely extends from the bogus #pragma pack directives for MSVC in begin_code.h, which will force types to be *underaligned* (and is attempting to work around something that is fundamentally a broken idea to be doing). In particular 8-byte-aligned types will be underaligned to 4 bytes, but only on MSVC. Since that code is not used for GCC that is probably the cause of the struct layout discrepancy, and there are likely other instances of that throughout SDL. Moreover, the supposed fix here is not in fact a fix, as now GCC will think SDL_AudioCVT is only 1-byte-aligned but MSVC will think it's 4-byte or 8-byte-aligned, meaning ABI incomatibility is introduced by this change. However, removing it would break ABI compatibility for purely-GCC-compiled code (as old binaries would see the struct as 1-byte-aligned and new binaries would see the struct as 8-byte-aligned) so SDL is stuck with this until it bumps its ABI. |
||
---|---|---|
.github | ||
VisualC | ||
VisualC-WinRT | ||
Xcode | ||
Xcode-iOS | ||
acinclude | ||
android-project | ||
android-project-ant | ||
build-scripts | ||
cmake | ||
debian | ||
docs | ||
include | ||
src | ||
test | ||
visualtest | ||
wayland-protocols | ||
.gitignore | ||
Android.mk | ||
BUGS.txt | ||
CMakeLists.txt | ||
CREDITS.txt | ||
INSTALL.txt | ||
LICENSE.txt | ||
Makefile.in | ||
Makefile.minimal | ||
Makefile.os2 | ||
Makefile.pandora | ||
Makefile.psp | ||
Makefile.wiz | ||
README-SDL.txt | ||
README.md | ||
SDL2.spec.in | ||
SDL2Config.cmake | ||
TODO.txt | ||
WhatsNew.txt | ||
autogen.sh | ||
cmake_uninstall.cmake.in | ||
configure | ||
configure.ac | ||
sdl2-config-version.cmake.in | ||
sdl2-config.cmake.in | ||
sdl2-config.in | ||
sdl2.m4 | ||
sdl2.pc.in |
README.md
Simple DirectMedia Layer (SDL) Version 2.0
Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games.
More extensive documentation is available in the docs directory, starting with README.md
Enjoy!
Sam Lantinga (slouken@libsdl.org)