E:/program/Android_source/system/core/include/cutils/threads.h:60:4: error: #error "no thread_store_t implementation for your platform !!"
分析源码system/core/include/threads.h发现以下代码,定义HAVE_PTHREADS宏解决问题(LOCAL_CFLAGS += -DHAVE_PTHREADS)
#ifdef HAVE_PTHREADS
#include <pthread.h>
typedef struct {
pthread_mutex_t lock;
int has_tls;
pthread_key_t tls;
} thread_store_t;
#define THREAD_STORE_INITIALIZER { PTHREAD_MUTEX_INITIALIZER, 0, 0 }
#elif defined HAVE_WIN32_THREADS
#include <windows.h>
typedef struct {
int lock_init;
int has_tls;
DWORD tls;
CRITICAL_SECTION lock;
} thread_store_t;
#define THREAD_STORE_INITIALIZER { 0, 0, 0, {0, 0, 0, 0, 0, 0} }
#else
# error "no thread_store_t implementation for your platform !!"
#endif
2. 编译Skia出现 E:/program/Android_source/frameworks/base/include/utils/threads.h:345: error: 'pthread_rwlock_t' does not name a type
通过分析源码发现需定义SK_BUILD_FOR_ANDROID_NDK并且需要把HAVE_PTHREADS宏的定义去掉,呵呵,也就是2和3的问题都可以通过定义SK_BUILD_FOR_ANDROID_NDK宏解决。
3. 编译base/libs/utils出现 E:/program/Android_source/frameworks/base/include/utils/threads.h:345: error: 'pthread_rwlock_t' does not name a type错误
加入头文件地址LOCAL_C_INCLUDES += platform/bionic/libc/include