Ubuntu 12.04 Desktop 版本编译 Android 4.0.4 出错解决
2012-06-20 19:15
519 查看
环境配置检查结果, PASS:
出错1:
在 ubuild/core/combo/HOST_linux-x86.mk 文件中:
找到行:
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
改为:
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
出错2:
vim external/mesa3d/src/glsl/linker.cpp
添加:
#include <cstddef>
出错3:
vim external/oprofile/libpp/format_output.h
找到 94行,把 mutable 字符串注释掉;
问题3:
$vim external/gtest/src/../include/gtest/internal/gtest-param-util.h
添加:
#include <cstddef>
问题4:
在文件中插入一行:
LOCAL_LDLIBS := -lpthread -ldl
问题5:
$ vim frameworks/compile/slang/Android.mk
将
local_cflags_for_slang 所在行最后的 -Werror 去掉:
#local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
解决上述问题,编译 OK.
Build Environment Check Result Report ************************************************************* [OS]: Ubuntu 12.04 (64-bit) [WARNING] your ubuntu os version is higher than recommendation [Physical Memory Size] : 3960292 K-Bytes [WARNING] it's smaller than recommendation, may cause out-of-memory build error [make]: 3.81 (64-bit) [OK] [perl]: 5.14.2 (64-bit) [WARNING] your perl version is higher than recommendation [python]: 2.7.3 (64-bit) [WARNING] your python version is higher than recommendation [arm-linux-androideabi-gcc]: 4.4.3 (32-bit) [OK] [gcc]: 4.6.3 (64-bit) [WARNING] your gcc version is higher than recommendation [jdk]: 1.6.0_33 (64-bit) [OK] [bison]: 2.5 (64-bit) [WARNING] your bison version is higher than recommendation [flex]: 2.5.35 (64-bit) [OK] [gperf]: 3.0.3 (64-bit) [OK] [mingw]: Installed [OK] [unix2dos/tofrodos]: Installed [OK] [wine]: 1.4 (32-bit) [WARNING] your wine version is higher than recommendation *************************************************************
出错1:
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp :0:0: error: "_FORTIFY_SOURCE" redefined [-Werror] :0:0: note: this is the location of the previous definition cc1plus: all warnings being treated as errors make: *** [out/host/linux-x86/obj/EXECUTABLES/obbtool_intermediates/Main.o] Error 1解决办法:
在 ubuild/core/combo/HOST_linux-x86.mk 文件中:
找到行:
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
改为:
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
出错2:
external/mesa3d/src/glsl/linker.cpp:1394:49: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1394:50: error: ‘varyings’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1394:58: error: ‘offsetof’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1395:48: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1412:47: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1412:48: error: ‘position’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1414:47: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1414:48: error: ‘pointSize’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1424:47: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1424:48: error: ‘position’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1428:47: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1428:48: error: ‘frontFacingPointCoord’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1431:47: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1431:48: error: ‘frontFacingPointCoord’ was not declared in this scope host C++: libMesa <= external/mesa3d/src/glsl/loop_controls.cpp external/mesa3d/src/glsl/linker.cpp: In function ‘void link_shaders(const gl_context*, gl_shader_program*)’: external/mesa3d/src/glsl/linker.cpp:1734:49: error: expected primary-expression before ‘,’ token external/mesa3d/src/glsl/linker.cpp:1734:50: error: ‘fragColor’ was not declared in this scope external/mesa3d/src/glsl/linker.cpp:1734:59: error: ‘offsetof’ was not declared in this scope make[2]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1解决办法:
vim external/mesa3d/src/glsl/linker.cpp
添加:
#include <cstddef>
出错3:
In file included from external/oprofile/libpp/arrange_profiles.cpp:24:0: external/oprofile/libpp/format_output.h:94:22: error: reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive] host C++: liboprofile_pp <= external/oprofile/libpp/callgraph_container.cpp make[2]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/liboprofile_pp_intermediates/arrange_profiles.o] Error 1解决办法:
vim external/oprofile/libpp/format_output.h
找到 94行,把 mutable 字符串注释掉;
问题3:
In file included from external/gtest/src/../include/gtest/gtest-param-test.h:157:0, from external/gtest/src/../include/gtest/gtest.h:69, from external/gtest/src/../src/gtest.cc:34, from external/gtest/src/gtest-all.cc:36: external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type make[2]: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_main_host_intermediates/gtest_main.o] Error 1解决办法:
$vim external/gtest/src/../include/gtest/internal/gtest-param-util.h
添加:
#include <cstddef>
问题4:
out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Signals.o): In function `PrintStackTrace': /home/eavoo/mt6575v2/external/llvm/lib/Support/Unix/Signals.inc:219: undefined reference to `dladdr' /home/eavoo/mt6575v2/external/llvm/lib/Support/Unix/Signals.inc:231: undefined reference to `dladdr' out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Threading.o): In function `llvm::llvm_execute_on_thread(void (*)(void*), void*, unsigned int)': /home/eavoo/mt6575v2/external/llvm/lib/Support/Threading.cpp:96: undefined reference to `pthread_create' /home/eavoo/mt6575v2/external/llvm/lib/Support/Threading.cpp:91: undefined reference to `pthread_attr_setstacksize' /home/eavoo/mt6575v2/external/llvm/lib/Support/Threading.cpp:100: undefined reference to `pthread_join' out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `MutexImpl': /home/eavoo/mt6575v2/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init' /home/eavoo/mt6575v2/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype' /home/eavoo/mt6575v2/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared' /home/eavoo/mt6575v2/external/llvm/lib/Support/Mutex.cpp:89: undefined reference to `pthread_mutexattr_destroy' out/host/linux-x86/obj/STATIC_LIBRARIES/libLLVMSupport_intermediates/libLLVMSupport.a(Mutex.o): In function `llvm::sys::MutexImpl::tryacquire()': /home/eavoo/mt6575v2/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock' collect2: ld returned 1 exit status make[2]: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1$vim external/llvm/llvm-host-build.mk
在文件中插入一行:
LOCAL_LDLIBS := -lpthread -ldl
问题5:
frameworks/compile/slang/slang_rs_export_foreach.cpp: In static member function ‘static slang::RSExportForEach* slang::RSExportForEach::Create(slang::RSContext*, const clang::FunctionDecl*)’: frameworks/compile/slang/slang_rs_export_foreach.cpp:249:23: error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-variable] cc1plus: all warnings being treated as errors make[2]: *** [out/host/linux-x86/obj/EXECUTABLES/llvm-rs-cc_intermediates/slang_rs_export_foreach.o] Error 1解决办法:
$ vim frameworks/compile/slang/Android.mk
将
local_cflags_for_slang 所在行最后的 -Werror 去掉:
#local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
解决上述问题,编译 OK.
相关文章推荐
- Ubuntu 12.04编译android 4.0.4 SDK错误解决
- Ubuntu 12.04 LTS server 编译 android-4.0.4_r2.1遇到的问题和解决方法
- Cordova编译Android 22 以上版本,中文目录出错问题的解决办法
- 编译android 出错, java JDK版本版本切换(ubuntu)
- Ubuntu10.04编译android1.5源码出错问题解决
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- 解决Ubuntu升级到16后,导致Android编译出错的问题
- 64位Ubuntu 11.10下编译android gcc版本过高问题解决
- ubuntu 12.04编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- Ubuntu上搭建android BSP的开发编译环境 && 设置定时编译任务 && ubuntu从10.04升级到12.04后编译出错
- 在Ubuntu 12.04 LTS 64bit初始化Android编译环境后,遇到重启后卡住在Ubuntu logo,进不了desktop
- Android 编译出错版本匹配问题解决办法
- Ubuntu 编译Android源码出现Switch.pm出错信息的解决方法
- Ubuntu中编译Android 源码出现Switch.pm出错信息的解决方法
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- 64位Ubuntu 12.04下编译android gcc版本过高问题解决
- Ubuntu中编译Android JellyBean 4.2.1源码出现Switch.pm出错信息的解决方法
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- ubuntu 12.04(gcc降级)编译android代码遇到"_FORTIFY_SOURCE"的解决方法
- Ubuntu10.04编译android2.2源码出错问题解决