From 462076c909f10efd460595f2090a7cf76d595b74 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 24 Dec 2017 17:35:53 +0100 Subject: [PATCH] pcre: add patch fixing stack frame size detection --- pkgs/development/libraries/pcre/default.nix | 3 +++ .../libraries/pcre/stacksize-detection.patch | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/development/libraries/pcre/stacksize-detection.patch diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index e6055151301c..b34c9ff31f2c 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -33,6 +33,9 @@ in stdenv.mkDerivation rec { buildInputs = optional (hostPlatform.libc == "msvcrt") windows.mingw_w64_pthreads; + # https://bugs.exim.org/show_bug.cgi?id=2173 + patches = [ ./stacksize-detection.patch ]; + doCheck = !(with hostPlatform; isCygwin || isFreeBSD) && hostPlatform == buildPlatform; # XXX: test failure on Cygwin # we are running out of stack on both freeBSDs on Hydra diff --git a/pkgs/development/libraries/pcre/stacksize-detection.patch b/pkgs/development/libraries/pcre/stacksize-detection.patch new file mode 100644 index 000000000000..4bc97069b1e2 --- /dev/null +++ b/pkgs/development/libraries/pcre/stacksize-detection.patch @@ -0,0 +1,16 @@ +diff --git a/pcre_exec.c b/pcre_exec.c +--- a/pcre_exec.c ++++ b/pcre_exec.c +@@ -509,6 +509,12 @@ + (e.g. stopped by repeated call or recursion limit) + */ + ++#ifdef __GNUC__ ++static int ++match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode, ++ PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb, ++ unsigned int rdepth) __attribute__((noinline,noclone)); ++#endif + static int + match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode, + PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,