mbedtls: pick patch to fix 32-bit builds with GCC 15.3 (#542902)

This commit is contained in:
K900
2026-07-17 10:47:42 +00:00
committed by GitHub
2 changed files with 25 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
diff --git a/library/common.h b/library/common.h
index 1f59b32426..8c756bcb07 100644
--- a/library/common.h
+++ b/library/common.h
@@ -332,7 +332,8 @@ static inline void mbedtls_xor_no_simd(unsigned char *r,
uint32_t x = mbedtls_get_unaligned_uint32(a + i) ^ mbedtls_get_unaligned_uint32(b + i);
mbedtls_put_unaligned_uint32(r + i, x);
}
-#if defined(__IAR_SYSTEMS_ICC__)
+#if defined(__IAR_SYSTEMS_ICC__) || \
+ (defined(MBEDTLS_COMPILER_IS_GCC) && MBEDTLS_GCC_VERSION >= 150300)
if (n % 4 == 0) {
return;
}

View File

@@ -1,4 +1,9 @@
{ callPackage, fetchurl }:
{
lib,
stdenv,
callPackage,
fetchurl,
}:
callPackage ./generic.nix {
version = "3.6.6";
@@ -14,5 +19,10 @@ callPackage ./generic.nix {
url = "https://raw.githubusercontent.com/openwrt/openwrt/52b6c9247997e51a97f13bb9e94749bc34e2d52e/package/libs/mbedtls/patches/100-fix-gcc14-build.patch";
hash = "sha256-20bxGoUHkrOEungN3SamYKNgj95pM8IjbisNRh68Wlw=";
})
]
++ lib.optionals stdenv.hostPlatform.is32bit [
# Fixes build with GCC 15.3 on 32-bit platforms.
# See: https://github.com/Mbed-TLS/mbedtls/pull/10793
./fix-gcc153-32bit.patch
];
}