From 9ecfbe0c5bfc28a4d411a87093179cd8b97bda60 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Wed, 11 Aug 2021 05:07:42 -0400 Subject: [PATCH] mingw: Disalbe FORTIFY_SOURCE by default. In newer versions of mingw, programs compiled with FORTIFY_SOURCE need to link to libssp or they will have link-time errors. gmp has been broken since @pstn updated mingw-64 in c60a0b044747037b87e7ec24b60d221e261b8a6b --- pkgs/build-support/cc-wrapper/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix index 678027f9bf45..804f59286c7a 100644 --- a/pkgs/build-support/cc-wrapper/default.nix +++ b/pkgs/build-support/cc-wrapper/default.nix @@ -472,7 +472,7 @@ stdenv.mkDerivation { + optionalString hostPlatform.isCygwin '' hardening_unsupported_flags+=" pic" '' + optionalString targetPlatform.isMinGW '' - hardening_unsupported_flags+=" stackprotector" + hardening_unsupported_flags+=" stackprotector fortify" '' + optionalString targetPlatform.isAvr '' hardening_unsupported_flags+=" stackprotector pic" '' + optionalString (targetPlatform.libc == "newlib") ''