从安装与测试的情况来看,已经不支持ubuntu10.04之前的版本了。
编译会报:
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
同时,默认支持64位的系统,而32位的需要修改makefile文件才可以
在32位上编,报错:
Checking build tools versions...
build/core/main.mk:76: ************************************************************
build/core/main.mk:77: You are attempting to build on a 32-bit system.
build/core/main.mk:78: Only 64-bit build environments are supported beyond froyo/2.2.
build/core/main.mk:79: ************************************************************
build/core/main.mk:80: *** stop. Stop.
在32位机器上编,需要修改如下:
project build/
diff --git a/core/main.mk b/core/main.mk
index f761ba5..4ee4bf9 100644
--- a/core/main.mk
+++ b/core/main.mk
@@ -68,7 +68,7 @@ $(info Checking build tools versions...)
ifeq ($(BUILD_OS),linux)
build_arch := $(shell uname -m)
-ifneq (64,$(findstring 64,$(build_arch)))
+ifneq (i686,$(findstring i686,$(build_arch)))
$(warning ************************************************************)
$(warning You are attempting to build on a 32-bit system.)
$(warning Only 64-bit build environments are supported beyond froyo/2.2.)
project external/clearsilver/
diff --git a/cgi/Android.mk b/cgi/Android.mk
index 21c534b..37b8246 100644
--- a/cgi/Android.mk
+++ b/cgi/Android.mk
@@ -13,8 +13,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/cs/Android.mk b/cs/Android.mk
index 9f0e30a..275845d 100644
--- a/cs/Android.mk
+++ b/cs/Android.mk
@@ -9,8 +9,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/java-jni/Android.mk b/java-jni/Android.mk
index 21b4fd1..c1d38d2 100644
--- a/java-jni/Android.mk
+++ b/java-jni/Android.mk
@@ -34,8 +34,8 @@ LOCAL_C_INCLUDES := /
LOCAL_CFLAGS += -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
diff --git a/util/Android.mk b/util/Android.mk
index 386f379..b694ef4 100644
--- a/util/Android.mk
+++ b/util/Android.mk
@@ -18,8 +18,8 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
LOCAL_CFLAGS := -fPIC
# This forces a 64-bit build for Java6
-LOCAL_CFLAGS += -m64
-LOCAL_LDFLAGS += -m64
+LOCAL_CFLAGS += -m32
+LOCAL_LDFLAGS += -m32
LOCAL_NO_DEFAULT_COMPILER_FLAGS := true
我在ubuntu 10.04的32位,ubuntu 10.10的64位上编译可以成功。
如果编译时报错:
缺少libc开发包,安装即可: apt-get install libc6-dev-i386
apt-get install g++-multilib
apt-get install lib64z1-dev libc6-dev-amd64 g++-multilib lib64stdc++6
sudo apt-get install lib32z1-dev
错误1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
解决:
sudo apt-get install libc6-dev-i386
libc6-dev-amd64
错误2:
host Executable: acp (out/host/linux-x86/obj/EXECUTABLES/acp_intermediates/acp)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/libstdc++.a when searching for -lstdc++
解决:
sudo apt-get install g++-multilib
错误3:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libz.a when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.so when searching for -lz
/usr/bin/ld: skipping incompatible /usr/lib/libz.a when searching for -lz
/usr/bin/ld: cannot find -lz
解决:
sudo apt-get install lib32z1-dev
lib64z1-dev
错误4:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libncurses.so when searching for -lncurses
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.3/../../../libncurses.a when searching for -lncurses
/usr/bin/ld: skipping incompatible /usr/lib/libncurses.so when searching for -lncurses
/usr/bin/ld: skipping incompatible /usr/lib/libncurses.a when searching for -lncurses
/usr/bin/ld: cannot find -lncurses
解决:
sudo apt-get install lib32ncurses5-dev
错误5:
In file included from external/qemu/android/skin/window.c:19:
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:55:22: error: X11/Xlib.h: 没有那个文件或目录
prebuilt/linux-x86/sdl/include/SDL/SDL_syswm.h:56:23: error: X11/Xatom.h: 没有那个文件或目录
解决:
sudo apt-get install libx11-dev
对75.156机器进行了升级,从ubuntu 9.04-->ubuntu 9.10-->ubuntu 10.04
sudo apt-get install update-manager-core
启动升级工具:
sudo do-release-upgrade
How to compile Android 2.3 on Ubuntu 10.04 32bit
官方编译环境:
Ubuntu 10.04 64bit
64-bit Sun JDK
本文编译环境:
Ubuntu 10.04 32bit
32-bit Sun JDK
参考:
http://source.android.com/source/download.html
安装java1.6
met issues
1:issue "You are attempting to build on a 32-bit system"
How to fix:
$ vim build/core/main.mk
change
ifneq (64,$(findstring 64,$(build_arch)))
to
ifneq (i686,$(findstring i686,$(build_arch)))
$(warning ************************************************************)
$(warning You are attempting to build on a 32-bit system.)
$(warning Only 64-bit build environments are supported beyond froyo/2.2.)
$(warning ************************************************************)
$(error stop)
endif
external/clearsilver/cgi/Android.mk,
external/clearsilver/java-jni/Android.mk,
external/clearsilver/util/Android.mk,
external/clearsilver/cs/Android.mk
change
LOCAL_CFLAGS += -m64
LOCAL_LDFLAGS += -m64
to
LOCAL_CFLAGS += -m32
LOCAL_LDFLAGS += -m32
2:issue "host C: libclearsilver-jni <= external/clearsilver/java-jni/j_neo_util.c
In file included from /usr/include/features.h:378,
from /usr/include/string.h:26,
from external/clearsilver/java-jni/j_neo_util.c:1:
/usr/include/gnu/stubs.h:9:27: error: gnu/stubs-64.h: 没有那个文件或目录
make: *** [out/host/linux-x86/obj/SHARED_LIBRARIES/libclearsilver-jni_intermediates/j_neo_util.o]错误"
How to fix:
sudo apt-get install lib64z1-dev libc6-dev-amd64 g++-multilib lib64stdc++6
3:issue:
host SharedLib: libneo_util (out/host/linux-x86/obj/lib/libneo_util.so)
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/i486-linux-gnu/4.3.4/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libneo_util.so] Error 1
How to fix:
4
frameworks/base/core/java/android/app/ListActivity.java:319: inconvertible types
found : android.widget.AdapterView<capture of ?>
required: android.widget.ListView
onListItemClick((ListView)parent, v, position, id);
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
How to fix:
其实JDK的版本低了,用了1.5.0_06的版本,用1.6就可以了
5 arm-eabi-4.4.3
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc -mthumb-interwork -Ibionic/libc/private -o out/target/product/generic/obj/lib/crtbegin_dynamic.o -c bionic/libc/arch-arm/bionic/crtbegin_dynamic.S
prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc: /lib/tls/i686/cmov/libc.so.6: version `GLIBC_2.11' not found (required by prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-gcc)
make: *** [out/target/product/generic/obj/lib/crtbegin_dynamic.o] 错误 1
这是在32位Ubuntu上编译引起的arm-eabi-4.4.3版本问题,所以需要修改arm-eabi-4.4.0:
$ mv arm-eabi-4.4.3 to arm-eabi-4.4.3.old
$ ln -s arm-eabi-4.4.0 arm-eabi-4.4.3
Reference:
http://iopenfree.appspot.com/?p=4001
http://0123.blog.163.com/blog/static/478831201061214128901/