From 6a7af12cbd3d2c27a208cff577662fca7e729a93 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 11 Jul 2018 11:42:12 +0300 Subject: [PATCH] Fix build for Android after enabling handle-fork by default (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 | 4 +++- configure.ac | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 72b32a3b..5b559529 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/configure.ac b/configure.ac index 3170309d..9c28962a 100644 --- a/configure.ac +++ b/configure.ac @@ -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. -- 2.40.0