How to compile Android 2.3 on Ubuntu 10.04 32bit

來源:互聯網
上載者:User


官方編譯環境: 
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/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.