summary refs log tree commit diff
path: root/pkgs/development/libraries/pcre
diff options
context:
space:
mode:
authorRobin Gloster <mail@glob.in>2017-12-24 17:35:53 +0100
committerRobin Gloster <mail@glob.in>2017-12-29 02:18:35 +0100
commit462076c909f10efd460595f2090a7cf76d595b74 (patch)
treec1a172376f66c8d961a8ff81abc6fe436a2e4d10 /pkgs/development/libraries/pcre
parentb96bf4a89164548340fae5cae9ce60d281cda4ce (diff)
downloadnixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar.gz
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar.bz2
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar.lz
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar.xz
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.tar.zst
nixpkgs-462076c909f10efd460595f2090a7cf76d595b74.zip
pcre: add patch fixing stack frame size detection
Diffstat (limited to 'pkgs/development/libraries/pcre')
-rw-r--r--pkgs/development/libraries/pcre/default.nix3
-rw-r--r--pkgs/development/libraries/pcre/stacksize-detection.patch16
2 files changed, 19 insertions, 0 deletions
diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix
index e6055151301..b34c9ff31f2 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 00000000000..4bc97069b1e
--- /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,