Skip to content

Commit

Permalink
Add patch to set PCRE2 stack size dynamically, since 16MB isn't enoug…
Browse files Browse the repository at this point in the history
…h on OSX apparently
  • Loading branch information
staticfloat committed Jun 11, 2015
1 parent b3a7342 commit 31cde5b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -747,6 +747,7 @@ pcre2-$(PCRE_VER)/configure: pcre2-$(PCRE_VER).tar.bz2
pcre2-$(PCRE_VER)/config.status: pcre2-$(PCRE_VER)/configure
cd pcre2-$(PCRE_VER) && \
./configure $(CONFIGURE_COMMON) --enable-jit --includedir=$(build_includedir)
patch -p0 pcre2-10.10/RunTest < pcre2_RunTest.patch
touch -c $@
$(PCRE_SRC_TARGET): pcre2-$(PCRE_VER)/config.status
$(MAKE) -C pcre2-$(PCRE_VER) $(LIBTOOL_CCLD)
Expand Down
11 changes: 11 additions & 0 deletions deps/pcre2_RunTest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
290c290,297
< test2stack="-S 16"
---
> # Attempt to auto-detect the maximum stack size:
> MAX_STACK=$(( $(ulimit -H -s)/1024 ))
>
> # if that fails, default to 16MB
> if [ "$MAX_STACK" -eq 0 ]; then
> MAX_STACK=16
> fi
> test2stack="-S $MAX_STACK"

0 comments on commit 31cde5b

Please sign in to comment.