Add check for ARM to set WOLFSS_USE_ALIGN

This commit is contained in:
Eric Blankenhorn
2026-05-14 11:50:19 -05:00
parent 583dbaff60
commit 7df2ead36d
+13
View File
@@ -1706,6 +1706,19 @@ WOLFSSL_API word32 CheckRunTimeSettings(void);
#endif /* WOLFSSL_AESNI || WOLFSSL_ARMASM || USE_INTEL_SPEEDUP || \
* WOLFSSL_AFALG_XILINX */
/* ARM C-only builds: if the toolchain reports that the target does NOT
* support unaligned access, force the alignment-safe code paths. This
* catches Cortex-M (ARMv6-M, and ARMv7-M/v8-M built with
* -mno-unaligned-access) without penalizing unaligned-capable cores
* such as Cortex-A and AArch64. __ARM_FEATURE_UNALIGNED is defined by
* GCC, Clang and armclang per the ARM ACLE when unaligned access is
* available. */
#if defined(__arm__) && !defined(__ARM_FEATURE_UNALIGNED)
#ifndef WOLFSSL_USE_ALIGN
#define WOLFSSL_USE_ALIGN
#endif
#endif
/* Helpers for memory alignment */
#ifndef XALIGNED
#if defined(__GNUC__) || defined(__llvm__) || \