]> granicus.if.org Git - gc/commitdiff
Port BDWGC to Android/x86
authorIvan Maidanski <ivmai@mail.ru>
Sat, 29 Sep 2012 10:07:55 +0000 (14:07 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 29 Sep 2012 10:07:55 +0000 (14:07 +0400)
* include/private/gc_priv.h (SETJMP, LONGJMP, JMP_BUF): Explicitly
define to setjmp/longjmp/jmp_buf (instead of
sigsetjmp/siglongjmp/sigjmp_buf), respectively, if GC_NO_SIGSETJMP.
* include/private/gcconfig.h (GC_NO_SIGSETJMP): New macro, define for
Android/x86.
* include/private/gcconfig.h (NO_GETCONTEXT): define for Android/x86
(since getcontext is missing in Android).

include/private/gc_priv.h
include/private/gcconfig.h

index a7a2bb8643c112b924c1026642ab7ceab0f1615e..3032582cfcb430d8b5799a4db27ddb6b8a6cf6f8 100644 (file)
@@ -2309,7 +2309,8 @@ GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
 /* were possible, and a couple of routines to facilitate        */
 /* catching accesses to bad addresses when that's               */
 /* possible/needed.                                             */
-#if defined(UNIX_LIKE) || (defined(NEED_FIND_LIMIT) && defined(CYGWIN32))
+#if (defined(UNIX_LIKE) || (defined(NEED_FIND_LIMIT) && defined(CYGWIN32))) \
+    && !defined(GC_NO_SIGSETJMP)
 # if defined(SUNOS5SIGS) && !defined(FREEBSD) && !defined(LINUX)
 #  include <sys/siginfo.h>
 # endif
@@ -2320,13 +2321,13 @@ GC_INNER ptr_t GC_store_debug_info(ptr_t p, word sz, const char *str,
 # define JMP_BUF sigjmp_buf
 #else
 # ifdef ECOS
-#   define SETJMP(env)  hal_setjmp(env)
+#   define SETJMP(env) hal_setjmp(env)
 # else
 #   define SETJMP(env) setjmp(env)
 # endif
 # define LONGJMP(env, val) longjmp(env, val)
 # define JMP_BUF jmp_buf
-#endif /* !UNIX_LIKE */
+#endif /* !UNIX_LIKE || GC_NO_SIGSETJMP */
 
 /* Do we need the GC_find_limit machinery to find the end of a  */
 /* data segment.                                                */
index 98c2df082813bd192e04be37d661488c18576e7e..5fde4ffd2dfd388eca3e259410ede8ecf110586b 100644 (file)
 #            endif
              extern int _end[];
 #            define DATAEND (ptr_t)(_end)
+#            if defined(PLATFORM_ANDROID) && !defined(GC_NO_SIGSETJMP)
+               /* As of Android NDK r8b, _sigsetjmp is still missing    */
+               /* for x86 (setjmp is used instead to find data_start).  */
+#              define GC_NO_SIGSETJMP
+#            endif
 #       else
              extern int etext[];
 #            define DATASTART ((ptr_t)((((word) (etext)) + 0xfff) & ~0xfff))
                              || defined(OPENBSD) || defined(ARM32) \
                              || defined(MIPS) || defined(AVR32))) \
      || (defined(LINUX) && (defined(SPARC) || defined(M68K))) \
-     || (defined(RTEMS) && defined(I386))) && !defined(NO_GETCONTEXT)
+     || ((defined(RTEMS) || defined(PLATFORM_ANDROID)) && defined(I386))) \
+    && !defined(NO_GETCONTEXT)
 # define NO_GETCONTEXT
 #endif