Hi Leonardo,
These are the error messages and solutions I found from network. There may be other solutions.
My Environment:
Ubuntu 12.04 64 bit
imx-android-13.4.1.tar.gz
Sorry for that I forget what ubuntu packages I installed before building Android.
Q1
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
S1
To fix this, edit build/core/combo/HOST_linux-x86.mk and replace:
HOST_GLOBAL_CFLAGS += -D_FORTIFY_SOURCE=0
with
HOST_GLOBAL_CFLAGS += -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=0
Q2
ERROR: frameworks/compile/slang/slang_rs_export_foreach.cpp:247:23:
error: variable ‘ParamName’ set but not used [-Werror=unused-but-set-
variable]
S2
android/ics/frameworks/compile/slang/Android.mk
-local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter -Werror
+local_cflags_for_slang := -Wno-sign-promo -Wall -Wno-unused-parameter
Q3
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
S3
Adding a "#include <stddef.h>" to linker.cpp
Q4
ERROR: external/oprofile/libpp/format_output.h:94:22: error:
reference ‘counts’ cannot be declared ‘mutable’ [-fpermissive]
S4
external/oprofile/libpp/format_output.h
- mutable counts_t & counts;
+ counts_t & counts;
Q5
android_repo/external/llvm/lib/Support/Mutex.cpp:69: undefined reference to `pthread_mutexattr_init'
android_repo/external/llvm/lib/Support/Mutex.cpp:75: undefined reference to `pthread_mutexattr_settype'
android_repo/external/llvm/lib/Support/Mutex.cpp:80: undefined reference to `pthread_mutexattr_setpshared'
android_repo/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()':
android_repo/external/llvm/lib/Support/Mutex.cpp:143: undefined reference to `pthread_mutex_trylock'
collect2: ld returned 1 exit status
S5
Way1:
system/extras/tests/bionic/libc/Android.mk
LOCAL_MODULE_TAGS := tests
-LOCAL_LDFLAGS := \
+LOCAL_LDLIBS := \
-lpthread \
-ldl
Way2:
external/llvm/llvm-host-build.mk
LOCAL_LDLIBS := -lpthread -ldl
Q6
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member ‘stat::st_dev’ [-Wmissing-field-initializers]
external/gtest/src/../src/gtest-filepath.cc:180:28: warning: missing initializer for member ‘stat::__pad1’ [-Wmissing-field-initializers]
...
...
...
external/gtest/src/../src/gtest-filepath.cc:208:28: warning: missing initializer for member ‘stat::st_ino’ [-Wmissing-field-initializers]
make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libgtest_host_intermediates/gtest-all.o] Error 1
S6
external/gtest/include/gtest/internal/gtest-param-util.h
add
#include <cstddef>