aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-01-25 15:08:01 +0100
committerRickard Green <[email protected]>2017-01-25 15:08:01 +0100
commit407ed6d3b1f9747b854b2a7ee0cf50bc689ebb8c (patch)
tree6654b23a07fd4f601d49fc104444676b27e8b339 /erts
parent3b9b3c97d370ee399b152ac0ad85cbffb187a14e (diff)
parentcd4a95b0abb45f07eef8a77991c2be8f5dea575e (diff)
downloadotp-407ed6d3b1f9747b854b2a7ee0cf50bc689ebb8c.tar.gz
otp-407ed6d3b1f9747b854b2a7ee0cf50bc689ebb8c.tar.bz2
otp-407ed6d3b1f9747b854b2a7ee0cf50bc689ebb8c.zip
Merge branch 'maint'
* maint: Workaround for buggy android implementation of PTHREAD_STACK_MIN
Diffstat (limited to 'erts')
-rw-r--r--erts/aclocal.m419
-rw-r--r--erts/lib_src/common/ethr_aux.c2
2 files changed, 20 insertions, 1 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index 6c0544da31..5ea4c2ccf3 100644
--- a/erts/aclocal.m4
+++ b/erts/aclocal.m4
@@ -1704,6 +1704,25 @@ case "$THR_LIB_NAME" in
AC_DEFINE(ETHR_TIME_WITH_SYS_TIME, 1, \
[Define if you can safely include both <sys/time.h> and <time.h>.]))
+ AC_MSG_CHECKING([for usable PTHREAD_STACK_MIN])
+ pthread_stack_min=no
+ AC_TRY_COMPILE([
+#include <limits.h>
+#if defined(ETHR_NEED_NPTL_PTHREAD_H)
+#include <nptl/pthread.h>
+#elif defined(ETHR_HAVE_MIT_PTHREAD_H)
+#include <pthread/mit/pthread.h>
+#elif defined(ETHR_HAVE_PTHREAD_H)
+#include <pthread.h>
+#endif
+ ],
+ [return PTHREAD_STACK_MIN;],
+ [pthread_stack_min=yes])
+
+ AC_MSG_RESULT([$pthread_stack_min])
+ test $pthread_stack_min != yes || {
+ AC_DEFINE(ETHR_HAVE_USABLE_PTHREAD_STACK_MIN, 1, [Define if you can use PTHREAD_STACK_MIN])
+ }
dnl
dnl Check for functions
diff --git a/erts/lib_src/common/ethr_aux.c b/erts/lib_src/common/ethr_aux.c
index 420efd725f..3501fe335a 100644
--- a/erts/lib_src/common/ethr_aux.c
+++ b/erts/lib_src/common/ethr_aux.c
@@ -220,7 +220,7 @@ ethr_init_common__(ethr_init_data *id)
ethr_min_stack_size__ += ethr_pagesize__;
#endif
/* The system may think that we need more stack */
-#if defined(PTHREAD_STACK_MIN)
+#if defined(ETHR_HAVE_USABLE_PTHREAD_STACK_MIN)
if (ethr_min_stack_size__ < PTHREAD_STACK_MIN)
ethr_min_stack_size__ = PTHREAD_STACK_MIN;
#elif defined(_SC_THREAD_STACK_MIN)