Fix some problem to build android2.3 on ubuntu11.10 32bit

錯誤1:

************************************************************

You are attempting to build on a 32-bit system.

Only 64-bit build environments are supported beyond froyo/2.2.

************************************************************

解決:

需要進行如下修改即可,將

./external/clearsilver/cgi/Android.mk

./external/clearsilver/java-jni/Android.mk

./external/clearsilver/util/Android.mk

./external/clearsilver/cs/Android.mk

四個文件中的

LOCAL_CFLAGS += -m64

LOCAL_LDFLAGS += -m64

註釋掉,或者將“64”換成“32”

LOCAL_CFLAGS += -m32

LOCAL_LDFLAGS += -m32

然後,將./build/core/main.mk 中的

ifneq (64,$(findstring 64,$(build_arch)))

改爲:

ifneq (i686,$(findstring i686,$(build_arch)))

錯誤2:

host C++: libutils <= frameworks/base/libs/utils/RefBase.cpp

frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’:

frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive]

make: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libutils_intermediates/RefBase.o] 錯誤 1

解決:

gedit frameworks/base/libs/utils/Android.mk

Change the line:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS)

To:

LOCAL_CFLAGS += -DLIBUTILS_NATIVE=1 $(TOOL_CFLAGS) –fpermissive

錯誤3:

host Executable: aapt (out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt)

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:27: undefined reference to `pthread_getspecific'

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set':

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create'

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific'

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/aapt_intermediates/aapt] 錯誤 1

解決:

打開 frameworks/base/tools/aapt/Android.mk

然後打開文件Android.mk,編輯下面一行:

ifeq ($(HOST_OS),linux)

#LOCAL_LDLIBS += -lrt       把這行註釋掉,改爲下面一行。

LOCAL_LDLIBS += -lrt -lpthread

endif

錯誤4:

target Dex: core

#

# An unexpected error has been detected by HotSpot Virtual Machine:

#

#  SIGSEGV (0xb) at pc=0x4003d848, pid=7668, tid=2889534320

#

# Java VM: Java HotSpot(TM) Client VM (1.5.0_22-b03 mixed mode)

# Problematic frame:

# C  [libpthread.so.0+0xa848]  pthread_cond_timedwait+0x168

#

# An error report file with more information is saved as hs_err_pid7668.log

#

# If you would like to submit a bug report, please visit:

#   http://java.sun.com/webapps/bugreport/crash.jsp

#

make: *** [out/target/common/obj/JAVA_LIBRARIES/core_intermediates/classes.dex] 已放棄 (core dumped)

解決:

虛擬機給的內存512太小,給個1G試試。然後在本機裏打開任務管理器,找到虛擬機進程,優先級設置爲實時。給他最多東西。

錯誤 5:

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_get':

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:27: undefined reference to `pthread_getspecific'

out/host/linux-x86/obj/STATIC_LIBRARIES/libcutils_intermediates/libcutils.a(threads.o): In function `thread_store_set':

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:36: undefined reference to `pthread_key_create'

/home/leno/works/android_dev/bin/system/core/libcutils/threads.c:44: undefined reference to `pthread_setspecific'

collect2: ld returned 1 exit status

make: *** [out/host/linux-x86/obj/EXECUTABLES/localize_intermediates/localize] 錯誤 1

解決:類似問題3

修改./framework/base/tools/localize/Android.mk文件

ifeq ($(HOST_OS),linux)

#LOCAL_LDLIBS += -lrt       把這行註釋掉,改爲下面一行。

LOCAL_LDLIBS += -lrt -lpthread

endif
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章