From 9ff0e609fe7a6bd61e9f289b3f5c0bed3f55e751 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 23 Nov 2024 01:12:57 +0000 Subject: [PATCH 1/2] mbedtls: add OpenWrt patch for GCC 14 --- pkgs/development/libraries/mbedtls/3.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/mbedtls/3.nix b/pkgs/development/libraries/mbedtls/3.nix index 9655393615b9..0722638c274b 100644 --- a/pkgs/development/libraries/mbedtls/3.nix +++ b/pkgs/development/libraries/mbedtls/3.nix @@ -1,6 +1,17 @@ -{ callPackage }: +{ callPackage, fetchurl }: callPackage ./generic.nix { version = "3.6.2"; hash = "sha256-tSWhF8i0Tx9QSFmyDEHdd2xveZvpyd+HXR+8xYj2Syo="; + patches = [ + # Fixes the build with GCC 14. + # + # See: + # * + # * + (fetchurl { + url = "https://raw.githubusercontent.com/openwrt/openwrt/52b6c9247997e51a97f13bb9e94749bc34e2d52e/package/libs/mbedtls/patches/100-fix-gcc14-build.patch"; + hash = "sha256-20bxGoUHkrOEungN3SamYKNgj95pM8IjbisNRh68Wlw="; + }) + ]; } From 30ebe557e44b2775ab9686e70ec4583c7424f1d9 Mon Sep 17 00:00:00 2001 From: Emily Date: Sat, 23 Nov 2024 01:15:05 +0000 Subject: [PATCH 2/2] mbedtls: remove obsolete GCC 14 warning flag This was fixed upstream by . --- pkgs/development/libraries/mbedtls/generic.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/development/libraries/mbedtls/generic.nix b/pkgs/development/libraries/mbedtls/generic.nix index 14545a2710fc..e87a133eb2a1 100644 --- a/pkgs/development/libraries/mbedtls/generic.nix +++ b/pkgs/development/libraries/mbedtls/generic.nix @@ -47,10 +47,6 @@ stdenv.mkDerivation rec { "-DGEN_FILES=off" ]; - env = lib.optionalAttrs (stdenv.cc.isGNU && (lib.versionAtLeast (lib.getVersion stdenv.cc.cc) "14")) { - NIX_CFLAGS_COMPILE = "-Wno-error=calloc-transposed-args"; - }; - doCheck = true; # Parallel checking causes test failures