]> granicus.if.org Git - gc/commitdiff
Fix gctest with musl libc on s390x
authorNatanael Copa <ncopa@alpinelinux.org>
Tue, 6 Feb 2018 20:21:23 +0000 (21:21 +0100)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 2 Mar 2018 17:12:50 +0000 (20:12 +0300)
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.

tests/test.c

index 7a45884ff684767d397a137a56baecf96669ad95..b9a4cbd77822ac45bc82bc3bf31f1412b37f5cf4 100644 (file)
@@ -2239,7 +2239,8 @@ int main(void)
     }
 #   if defined(GC_IRIX_THREADS) || defined(GC_FREEBSD_THREADS) \
         || defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) \
-        || defined(GC_OPENBSD_THREADS) || defined(DEFAULT_STACK_MAYBE_SMALL)
+        || defined(GC_OPENBSD_THREADS) || defined(DEFAULT_STACK_MAYBE_SMALL) \
+        || defined(NO_GETCONTEXT) /* e.g. musl libc */
         if ((code = pthread_attr_setstacksize(&attr, 1000 * 1024)) != 0) {
           GC_printf("pthread_attr_setstacksize failed, error=%d\n", code);
           FAIL;