main/python2: set thread stack size to 1 MiB

We need increase stack size so we dont segfautl before we hit the
recursion limit.
This commit is contained in:
Natanael Copa 2017-12-14 15:43:52 +00:00
parent ea3800db78
commit 2f35283fec

View File

@ -4,7 +4,7 @@ pkgname=python2
# the python2-tkinter's pkgver needs to be synchronized with this.
pkgver=2.7.14
_verbase=${pkgver%.*}
pkgrel=1
pkgrel=2
pkgdesc="A high-level scripting language"
url="http://www.python.org"
arch="all"
@ -36,7 +36,7 @@ prepare() {
build() {
cd "$builddir"
export OPT="$CFLAGS"
export OPT="$CFLAGS -DTHREAD_STACK_SIZE=0x100000"
./configure \
--build=$CBUILD \
--host=$CHOST \
@ -51,6 +51,26 @@ build() {
make
}
check() {
cd "$builddir"
# test that we reach recursionlimit before we segfault
cat > test-stacksize.py <<-EOF
import threading
import sys
def fun(i):
try:
fun(i+1)
except:
sys.exit(0)
t = threading.Thread(target=fun, args=[1])
t.start()
EOF
LD_LIBRARY_PATH=$PWD ./python test-stacksize.py
}
package() {
cd "$builddir"
make -j1 DESTDIR="$pkgdir" install