From 14109047bdda9d3522a1968b59d75e5520c11775 Mon Sep 17 00:00:00 2001 From: Danie Roux Date: Sat, 7 Sep 2013 16:36:10 +0200 Subject: [PATCH] gettext: Guard against compiler not supporting __builtin_stpncpy From https://lists.macosforge.org/pipermail/macports-dev/2011-July/015263.html: 5) Building with a compiler that doesn't support newer __builtins If your port uses MacPorts compilers rather than the default compiler, you may run into trouble with string functions. You'll see errors at link time about undefined __builtin_* functions. If this happens, you may want to compile with -D_FORTIFY_SOURCE=0 to tell the headers to use unfortified versions which do not use compiler builtins. --- pkgs/development/libraries/gettext/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix index 5468c9f2336..dbc17ffa1bb 100644 --- a/pkgs/development/libraries/gettext/default.nix +++ b/pkgs/development/libraries/gettext/default.nix @@ -19,6 +19,9 @@ stdenv.mkDerivation (rec { "--config-cache" ]); + makeFlags = stdenv.lib.optionalString stdenv.isDarwin + "CFLAGS=-D_FORTIFY_SOURCE=0"; + # On cross building, gettext supposes that the wchar.h from libc # does not fulfill gettext needs, so it tries to work with its # own wchar.h file, which does not cope well with the system's