当我在ubuntu16.04上构建android5.0时,我收到以下错误:
external / libcxx / include / atomic:539:2:错误:#error未实现 art / runtime / atomic.h:155:5:错误:' atomic_thread_fence'不是' std'的成员 art / runtime / atomic.h:155:30:错误:' memory_order_acquire'不是' std'的成员 art / runtime / entrypoints / entrypoint_utils.h:50:44:错误:' art :: mirror :: Class * art :: CheckClassInitializedForObjectAlloc(art :: mirror :: Class *,art :: Thread *,bool * )'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:146:33:错误:' art :: mirror :: ArtField * art :: FindFieldFast(uint32_t,art :: mirror :: ArtMethod *,art :: FindFieldType,size_t )'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:152:34:错误:' art :: mirror :: ArtMethod * art :: FindMethodFast(uint32_t,art :: mirror :: Object *,art :: mirror :: ArtMethod *,bool,art :: InvokeType)'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:158:30:错误:' art :: mirror :: Class * art :: ResolveVerifyAndClinit(uint32_t,art :: mirror :: ArtMethod *,art :: Thread *, bool,bool)'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:166:31:错误:' art :: mirror :: String * art :: ResolveStringFromCode(art :: mirror :: ArtMethod *,uint32_t)'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:171:20:错误:' void art :: UnlockJniSynchronizedMethod(jobject,art :: Thread *)'声明'静态'但从未定义[-Werror = unused-function] art / runtime / entrypoints / entrypoint_utils.h:177:20:错误:' void art :: CheckSuspend(art :: Thread *)'声明'静态'但从未定义[-Werror = unused-function] cc1plus:所有警告都被视为错误
为什么会出现?
答案 0 :(得分:1)
我通过修改$ANDROID_REPO/art/build/Android.common_build.mk
:
-#ART_HOST_CLANG := false
-#ifneq ($(WITHOUT_HOST_CLANG),true)
- # By default, host builds use clang for better warnings.
ART_HOST_CLANG := true
-#endif
确保ART_HOST_CLANG = true
。然后,我创建了以下符号链接:
ln -sf /usr/bin/ld.gold $ANDROID_REPO/prebuilts/gcc/linux-x86/host/(glibc version)/x86_64-linux/bin/ld