aboutsummaryrefslogtreecommitdiffstats
path: root/main/guile
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-09-27 06:47:07 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-09-27 06:57:33 +0000
commit4a121590963d841e0f1bf3590d8ec2727b339345 (patch)
tree2d499c1f3798aa2dc51b84a65d49995568960625 /main/guile
parent7d973a1e2165edf7318ef287a836a2f6b6baae2a (diff)
downloadaports-4a121590963d841e0f1bf3590d8ec2727b339345.tar.gz
aports-4a121590963d841e0f1bf3590d8ec2727b339345.tar.bz2
aports-4a121590963d841e0f1bf3590d8ec2727b339345.tar.xz
main/guile: fix bootstrap failure
the garbage collector uses recursive functions while bootstrapping the build and runs out of stack space. Fix it by explicitly set thread stack size when creating the thread. fixes #7919
Diffstat (limited to 'main/guile')
-rw-r--r--main/guile/APKBUILD9
-rw-r--r--main/guile/stacksize.patch28
2 files changed, 34 insertions, 3 deletions
diff --git a/main/guile/APKBUILD b/main/guile/APKBUILD
index 228af42e61..c07b32a1a2 100644
--- a/main/guile/APKBUILD
+++ b/main/guile/APKBUILD
@@ -1,7 +1,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=guile
pkgver=2.2.2
-pkgrel=0
+pkgrel=1
pkgdesc="Guile is a portable, embeddable Scheme implementation written in C"
url="http://www.gnu.org/software/guile/"
arch="all"
@@ -13,6 +13,7 @@ depends=
depends_dev="guile gc-dev"
source="ftp://ftp.gnu.org/pub/gnu/$pkgname/$pkgname-$pkgver.tar.gz
0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
+ stacksize.patch
"
builddir="$srcdir"/$pkgname-$pkgver
@@ -24,7 +25,8 @@ build() {
--host=$CHOST \
--prefix=/usr \
--disable-error-on-warning \
- --disable-static
+ --disable-static \
+ --with-threads
make
}
@@ -35,4 +37,5 @@ package() {
}
sha512sums="dfc4a413faa8d7cd111beb3673e52be3d95c5c408c6796c874cdd01c095a05bc266856c45067aef3b931889349980d0985dde269aabde18f21659d02f5c2344d guile-2.2.2.tar.gz
-54a9fe0fa2ea83da7ae61f96612e3e653ec80f60ab41d1995dc44bd05c7ff68cc4fab36a655e8835c4ab1cf0966765a299ef2d73cb9f69d3ef955e6aeaa8062d 0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch"
+54a9fe0fa2ea83da7ae61f96612e3e653ec80f60ab41d1995dc44bd05c7ff68cc4fab36a655e8835c4ab1cf0966765a299ef2d73cb9f69d3ef955e6aeaa8062d 0002-Mark-mutex-with-owner-not-retained-threads-test-as-u.patch
+d9a1631abe91bfafd772667d2870d80557a3f6e3886d7ec101354633995b405a4452c329dfd1958c9d5e97bc6af32d5f7885ab0ef869edf2e6b9fec142c5ecfa stacksize.patch"
diff --git a/main/guile/stacksize.patch b/main/guile/stacksize.patch
new file mode 100644
index 0000000000..f89f970b16
--- /dev/null
+++ b/main/guile/stacksize.patch
@@ -0,0 +1,28 @@
+diff --git a/libguile/finalizers.c b/libguile/finalizers.c
+index c5d69e8..f8d78d8 100644
+--- a/libguile/finalizers.c
++++ b/libguile/finalizers.c
+@@ -246,11 +246,19 @@ start_finalization_thread (void)
+ to block on any lock that scm_spawn_thread might want to take,
+ and we don't want to inherit the dynamic state (fluids) of the
+ caller. */
+- if (pthread_create (&finalization_thread, NULL,
+- run_finalization_thread, NULL))
+- perror ("error creating finalization thread");
++ pthread_attr_t attr;
++ if (pthread_attr_init(&attr))
++ perror ("pthread_attr_init");
+ else
+- finalization_thread_is_running = 1;
++ {
++ if (pthread_attr_setstacksize(&attr, 256 * 1024) == 0 &&
++ pthread_create (&finalization_thread, &attr,
++ run_finalization_thread, NULL) == 0)
++ finalization_thread_is_running = 1;
++ else
++ perror ("error creating finalization thread");
++ pthread_attr_destroy(&attr);
++ }
+ }
+ scm_i_pthread_mutex_unlock (&finalization_thread_lock);
+ }