From 341236cd69d89743a6ab6a177115ee9285f1d551 Mon Sep 17 00:00:00 2001 From: ghpzin Date: Mon, 8 Dec 2025 00:59:05 +0300 Subject: [PATCH] linphonePackages.bc-mbedtls: fix build with gcc15 - add patches from merged upstream PR included in versions 3.6.4+: https://www.github.com/Mbed-TLS/mbedtls/pull/10215 https://github.com/Mbed-TLS/mbedtls/commit/d593c54b3cbfc3c806476a725e7d82763da0da9e Fixes build failure with gcc15: ``` /build/source/library/ssl_tls13_keys.h:14:40: error: initializer-string for array of 'unsigned char' truncates NUL terminator but destination lacks 'nonstring' attribute (9 chars into 8 available) [-Werror=unterminated-string-initialization] 14 | MBEDTLS_SSL_TLS1_3_LABEL(finished, "finished") \ | ^~~~~~~~~~ /build/source/library/ssl_tls13_keys.c:38:13: note: in definition of macro 'MBEDTLS_SSL_TLS1_3_LABEL' 38 | .name = string, | ^~~~~~ /build/source/library/ssl_tls13_keys.c:44:5: note: in expansion of macro 'MBEDTLS_SSL_TLS1_3_LABEL_LIST' 44 | MBEDTLS_SSL_TLS1_3_LABEL_LIST | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` --- .../linphone/bc-mbedtls/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/applications/networking/instant-messengers/linphone/bc-mbedtls/default.nix b/pkgs/applications/networking/instant-messengers/linphone/bc-mbedtls/default.nix index ad08bf4996b5..9172f6a0519c 100644 --- a/pkgs/applications/networking/instant-messengers/linphone/bc-mbedtls/default.nix +++ b/pkgs/applications/networking/instant-messengers/linphone/bc-mbedtls/default.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitLab, + fetchpatch, cmake, ninja, @@ -27,6 +28,17 @@ stdenv.mkDerivation { fetchSubmodules = true; }; + patches = [ + # Fix build with gcc15 + # https://www.github.com/Mbed-TLS/mbedtls/pull/10215 + (fetchpatch { + name = "linphone-mbedtls-fix-unterminated-string-initialization.patch"; + url = "https://github.com/Mbed-TLS/mbedtls/commit/d593c54b3cbfc3c806476a725e7d82763da0da9e.patch"; + hash = "sha256-hh2cGzL75fEqlFNhEyL2fI9qsBW2Eq43DdWFD9qLsKE="; + excludes = [ "ChangeLog.d/unterminated-string-initialization.txt" ]; + }) + ]; + nativeBuildInputs = [ cmake ninja