fix a bug of the android Makefile for nsync library
authorgdh1995 <gdh1995@qq.com>
Mon, 21 May 2018 06:23:32 +0000 (14:23 +0800)
committergdh1995 <gdh1995@qq.com>
Tue, 22 May 2018 02:52:14 +0000 (10:52 +0800)
NDK doesn't support thread_local variables which require destructors,
so on Android it should use __thread instead.

Observations:
* ProtoBuf and other libraries are not using thread_local on Android.
* In Tensorflow, there's a "thread_local" in code about CUDA,
  which should be safe enough.

More discussions are on https://github.com/android-ndk/ndk/issues/360 .

tensorflow/contrib/makefile/compile_nsync.sh

index e8c6edd..a28fc3a 100755 (executable)
@@ -270,7 +270,7 @@ for arch in $archs; do
                         PLATFORM_LDFLAGS=-pthread
                         MKDEP=${CC} -M -std=c++11
                         PLATFORM_C=../../platform/c++11/src/nsync_semaphore_mutex.cc \
-                                   ../../platform/c++11/src/per_thread_waiter.cc \
+                                   ../../platform/posix/src/per_thread_waiter.c \
                                    ../../platform/c++11/src/yield.cc \
                                    ../../platform/c++11/src/time_rep_timespec.cc \
                                    ../../platform/c++11/src/nsync_panic.cc