From: Ivan Maidanski Date: Thu, 26 Jan 2012 05:16:10 +0000 (+0400) Subject: Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android X-Git-Tag: gc7_2~76 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=145af1505392a502af230c1324b5e7afab8f6ccb;p=gc Fix gcconfig.h to define USE_GET_STACKBASE_FOR_MAIN for Android (causing pthread_attr_getstack to be used to get main stack base even in single-threaded mode instead of GC_linux_main_stack_base) * include/private/gcconfig.h (USE_GET_STACKBASE_FOR_MAIN): Define if PLATFORM_ANDROID. --- diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index cd019eb7..0b8bc74b 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -2339,6 +2339,14 @@ # define DATAEND (ptr_t)(end) #endif +#if defined(PLATFORM_ANDROID) && !defined(THREADS) \ + && !defined(USE_GET_STACKBASE_FOR_MAIN) + /* Always use pthread_attr_getstack on Android ("-lpthread" option is */ + /* not needed to be specified manually) since GC_linux_main_stack_base */ + /* causes app crash if invoked inside Dalvik VM. */ +# define USE_GET_STACKBASE_FOR_MAIN +#endif + #if (defined(SVR4) || defined(PLATFORM_ANDROID)) && !defined(GETPAGESIZE) # include # define GETPAGESIZE() sysconf(_SC_PAGESIZE)