aboutsummaryrefslogtreecommitdiffstats
path: root/main/gc/0001-Fix-gctest-with-musl-libc-on-s390x.patch
blob: c607d2d1529c1b8d7094294dec713a99d2e19c90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
From 63ea237b7c367c56b6e14dd4d634b622e3fc0aa7 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Tue, 6 Feb 2018 21:21:23 +0100
Subject: [PATCH] Fix gctest with musl libc on s390x

Issue #202 (bdwgc).

DEFAULT_STACK_MAYBE_SMALL is only set if PARALLEL_MARK is set, but stack
is too small on musl libc even if PARALLEL_MARK is unset. We solve this
by detecting musl via NO_GETCONTEXT.
---
--- a/tests/test.c
+++ b/tests/test.c
@@ -2313,7 +2313,7 @@
     }
 #   if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
         || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
-        || defined(GC_OPENBSD_THREADS)
+        || defined(GC_OPENBSD_THREADS) || defined(NO_GETCONTEXT) /* musl libc */
         if ((code = pthread_attr_setstacksize(&attr, 1000 * 1024)) != 0) {
           GC_printf("pthread_attr_setstacksize failed, error=%d\n", code);
           FAIL;