编译Android ICS错误解决办法

环境:Ubuntu 12.04.2 LTS

编译:ICS

./mk-ics.sh 4

make hisdk

#########################
make: *** [out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/noproguard.classes-with-local.dex] killed

enlarge swap memory size
sudo dd if=/dev/zero of=swapfile bs=1024 count=1024288
sudo mkswap swapfile
sudo swapon swapfile

#############################
host C++: obbtool <= frameworks/base/tools/obbtool/Main.cpp
<command-line>:0:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
<built-in>: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
make: *** Waiting for unfinished jobs....

solutions:
modify "build/core/combo/HOST_linux-x86.mk"
-HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
+HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0

###########################
external/mesa3d/src/glsl/linker.cpp:623:33: warning:  by ‘virtual ir_visitor_status remap_variables(ir_instruction*, gl_shader*, hash_table*)::remap_visitor::visit(ir_dereference_variable*)’ [-Woverloaded-virtual]host C++: libMesa <= external/mesa3d/src/glsl/loop_analysis.cpp

external/mesa3d/src/glsl/linker.cpp: In function ‘void assign_varying_locations(gl_shader_program*, gl_shader*, gl_shader*)’:
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
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: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libMesa_intermediates/src/glsl/linker.o] Error 1

solutions:
+#include <stddef.h>
#include <cstdlib>
#include <cstdio>

############################


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/gtest_main.cc:32:
external/gtest/src/../include/gtest/internal/gtest-param-util.h:122:11: error: ‘ptrdiff_t’ does not name a type
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
In file included from external/gtest/src/gtest-all.cc:38:0:

解决方法:
$vi external/gtest/src/../include/gtest/internal/gtest-param-util.h
#include <cstddef>

###############################
/home/htang/develop/hubei/HiSTBAndroidV400/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/EXECUTABLES/test-librsloader_intermediates/test-librsloader] Error 1

解决办法:
vim external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread  -ldl

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/d405504c011bad193eefa42b2da1ef18.html