mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
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. |
||
---|---|---|
.. | ||
begin_code.h | ||
close_code.h | ||
SDL_assert.h | ||
SDL_atomic.h | ||
SDL_audio.h | ||
SDL_bits.h | ||
SDL_blendmode.h | ||
SDL_clipboard.h | ||
SDL_config_android.h | ||
SDL_config_iphoneos.h | ||
SDL_config_macosx.h | ||
SDL_config_minimal.h | ||
SDL_config_os2.h | ||
SDL_config_pandora.h | ||
SDL_config_psp.h | ||
SDL_config_windows.h | ||
SDL_config_winrt.h | ||
SDL_config_wiz.h | ||
SDL_config.h | ||
SDL_config.h.cmake | ||
SDL_config.h.in | ||
SDL_copying.h | ||
SDL_cpuinfo.h | ||
SDL_egl.h | ||
SDL_endian.h | ||
SDL_error.h | ||
SDL_events.h | ||
SDL_filesystem.h | ||
SDL_gamecontroller.h | ||
SDL_gesture.h | ||
SDL_haptic.h | ||
SDL_hints.h | ||
SDL_joystick.h | ||
SDL_keyboard.h | ||
SDL_keycode.h | ||
SDL_loadso.h | ||
SDL_locale.h | ||
SDL_log.h | ||
SDL_main.h | ||
SDL_messagebox.h | ||
SDL_metal.h | ||
SDL_misc.h | ||
SDL_mouse.h | ||
SDL_mutex.h | ||
SDL_name.h | ||
SDL_opengl_glext.h | ||
SDL_opengl.h | ||
SDL_opengles2_gl2.h | ||
SDL_opengles2_gl2ext.h | ||
SDL_opengles2_gl2platform.h | ||
SDL_opengles2_khrplatform.h | ||
SDL_opengles2.h | ||
SDL_opengles.h | ||
SDL_pixels.h | ||
SDL_platform.h | ||
SDL_power.h | ||
SDL_quit.h | ||
SDL_rect.h | ||
SDL_render.h | ||
SDL_revision.h | ||
SDL_rwops.h | ||
SDL_scancode.h | ||
SDL_sensor.h | ||
SDL_shape.h | ||
SDL_stdinc.h | ||
SDL_surface.h | ||
SDL_system.h | ||
SDL_syswm.h | ||
SDL_test_assert.h | ||
SDL_test_common.h | ||
SDL_test_compare.h | ||
SDL_test_crc32.h | ||
SDL_test_font.h | ||
SDL_test_fuzzer.h | ||
SDL_test_harness.h | ||
SDL_test_images.h | ||
SDL_test_log.h | ||
SDL_test_md5.h | ||
SDL_test_memory.h | ||
SDL_test_random.h | ||
SDL_test.h | ||
SDL_thread.h | ||
SDL_timer.h | ||
SDL_touch.h | ||
SDL_types.h | ||
SDL_version.h | ||
SDL_video.h | ||
SDL_vulkan.h | ||
SDL.h |