File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1706,6 +1706,19 @@ WOLFSSL_API word32 CheckRunTimeSettings(void);
17061706#endif /* WOLFSSL_AESNI || WOLFSSL_ARMASM || USE_INTEL_SPEEDUP || \
17071707 * WOLFSSL_AFALG_XILINX */
17081708
1709+ /* ARM C-only builds: if the toolchain reports that the target does NOT
1710+ * support unaligned access, force the alignment-safe code paths. This
1711+ * catches Cortex-M (ARMv6-M, and ARMv7-M/v8-M built with
1712+ * -mno-unaligned-access) without penalizing unaligned-capable cores
1713+ * such as Cortex-A and AArch64. __ARM_FEATURE_UNALIGNED is defined by
1714+ * GCC, Clang and armclang per the ARM ACLE when unaligned access is
1715+ * available. */
1716+ #if defined(__arm__) && !defined(__ARM_FEATURE_UNALIGNED)
1717+ #ifndef WOLFSSL_USE_ALIGN
1718+ #define WOLFSSL_USE_ALIGN
1719+ #endif
1720+ #endif
1721+
17091722/* Helpers for memory alignment */
17101723#ifndef XALIGNED
17111724 #if defined(__GNUC__) || defined(__llvm__) || \
You can’t perform that action at this time.
0 commit comments