]> granicus.if.org Git - gc/commitdiff
Fix build for Android after enabling handle-fork by default
authorIvan Maidanski <ivmai@mail.ru>
Wed, 11 Jul 2018 08:42:12 +0000 (11:42 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 11 Jul 2018 08:42:12 +0000 (11:42 +0300)
(fix of commit 686a667)

Issue #174 (bdwgc).

* CMakeLists.txt [CMAKE_USE_PTHREADS_INIT]: Do not define HANDLE_FORK
macro for android host.
* configure.ac [$enable_handle_fork!=yes/no/manual && THREADS=xposix]:
Likewise.

CMakeLists.txt
configure.ac

index 72b32a3b24dd5a745b9b5a52f783e65ef0316f00..5b559529593b36a5cd9d382750d5785c960e5d48 100644 (file)
@@ -107,7 +107,9 @@ IF(CMAKE_USE_PTHREADS_INIT)
                 MESSAGE("Only on NetBSD 2.0 or later.")
                 ADD_DEFINITIONS("-D_PTHREADS")
         ENDIF()
-        IF( HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
+        IF( HOST MATCHES .*-.*-android.*)
+                # Android NDK does not provide pthread_atfork.
+        ELSEIF( HOST MATCHES .*-.*-aix.*|.*-.*-cygwin.*|.*-.*-freebsd.*|.*-.*-haiku.*|.*-.*-hpux11.*|.*-.*-irix.*|.*-.*-kfreebsd.*-gnu|.*-.*-.*linux.*|.*-.*-netbsd.*|.*-.*-openbsd.*|.*-.*-osf.*|.*-.*-solaris.*)
                 IF(enable_handle_fork)
                     ADD_DEFINITIONS("-DHANDLE_FORK")
                 ENDIF(enable_handle_fork)
index 3170309d65b9489ae529e2dc0ea5bb075a55b2ab..9c28962a50b89911784c4331c8ce6e09bdf121ea 100644 (file)
@@ -864,6 +864,9 @@ elif test "${enable_handle_fork}" != manual -a x$THREADS = xposix; then
     # If the option is omitted, pthread_atfork handlers are installed
     # by default for the targets where pthread_atfork is known to work.
     case "$host" in
+      *-*-android*)
+        # Android NDK does not provide pthread_atfork.
+        ;;
       *-*-darwin*)
         # The incremental mode (which is off if parallel marking) conflicts
         # with fork handling on Darwin.