Fix zstd on OpenBSD/sparc64

Functions like MEM_read32 could still perform unaligned accesses on
OpenBSD/sparc64 with gcc, possibly related to gcc bug 51628. The
solution is to switch to a safe memcpy-based solution and let the
compiler do any optimizations.
This commit is contained in:
Florian Märkl 2023-08-30 18:16:05 +02:00 committed by Anton Kochkov
parent b4a85e8904
commit c097bd7799

View file

@ -113,6 +113,10 @@ if cc_id == compiler_msvc
add_project_arguments(msvc_compile_flags, language: ['c', 'cpp'])
endif
# Use the safe way to access unaligned values as all other methods fail
# on OpenBSD/sparc64 with gcc.
add_project_arguments('-DMEM_FORCE_MEMORY_ACCESS=0', language: ['c', 'cpp'])
# =============================================================================
# Subdirs
# =============================================================================