openthread-br: fix build on GCC 14

This patch is taken from openwrt/openwrt@a41747ac8e ("mbedtls: fix
 build on GCC 14").

Fixes: #26570
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen
2025-05-25 18:41:17 +08:00
committed by Robert Marko
parent 8fff19135e
commit 937e2a5b80
2 changed files with 12 additions and 1 deletions

View File

@@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=openthread-br
PKG_SOURCE_DATE:=2024-11-20
PKG_SOURCE_VERSION:=bd7bc77742920eba3b3801a410c3eba3372c98bb
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL=https://github.com/openthread/ot-br-posix.git

View File

@@ -0,0 +1,11 @@
--- a/third_party/openthread/repo/third_party/mbedtls/repo/library/common.h
+++ b/third_party/openthread/repo/third_party/mbedtls/repo/library/common.h
@@ -199,7 +199,7 @@ static inline void mbedtls_xor(unsigned
uint8x16_t x = veorq_u8(v1, v2);
vst1q_u8(r + i, x);
}
-#if defined(__IAR_SYSTEMS_ICC__)
+#if defined(__IAR_SYSTEMS_ICC__) || (defined(MBEDTLS_COMPILER_IS_GCC) && MBEDTLS_GCC_VERSION >= 140100)
/* This if statement helps some compilers (e.g., IAR) optimise out the byte-by-byte tail case
* where n is a constant multiple of 16.
* For other compilers (e.g. recent gcc and clang) it makes no difference if n is a compile-time