我的主機是 debian 6 x86_64
同步完Android 4.0 的源碼後,進行編譯。
google 官方只有Ubuntu 的解決方案,只字未提debian.
看來google 與ubuntu 關系很好!
以下為出錯日志,現在還未解決,
看上去是.so 版本不匹配,找不到相應的函數。
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(ClDisplay.o): In function `XCloseDisplay':
(.text+0xbd): undefined reference to `xcb_disconnect'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(OpenDis.o): In function `OutOfMemory':
(.text+0x449): undefined reference to `xcb_disconnect'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0x7f4): undefined reference to `xcb_get_setup'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(OpenDis.o): In function `XOpenDisplay':
(.text+0xd6d): undefined reference to `xcb_get_maximum_request_length'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0xa8): undefined reference to `xcb_parse_display'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x15e): undefined reference to `xcb_connect_to_display_with_auth_info'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x17c): undefined reference to `xcb_get_file_descriptor'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x1a3): undefined reference to `xcb_generate_id'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x1e0): undefined reference to `xcb_connection_has_error'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_disp.o): In function `_XConnectXCB':
(.text+0x214): undefined reference to `xcb_connect'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `require_socket':
(.text+0x3b4): undefined reference to `xcb_take_socket'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `wait_or_poll_for_event':
(.text+0x43c): undefined reference to `xcb_wait_for_event'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `wait_or_poll_for_event':
(.text+0x4a5): undefined reference to `xcb_poll_for_event'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `process_responses':
(.text+0x56b): undefined reference to `xcb_poll_for_reply'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `process_responses':
(.text+0x6ea): undefined reference to `xcb_connection_has_error'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `_XAllocIDs':
(.text+0x7dc): undefined reference to `xcb_generate_id'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `_XIDHandler':
(.text+0x84e): undefined reference to `xcb_generate_id'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `_XSend':
(.text+0xa41): undefined reference to `xcb_writev'
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/../../../../lib32/libX11.a(xcb_io.o): In function `_XReply':
(.text+0xc2a): undefined reference to `xcb_wait_for_reply'
collect2: ld returned 1 exit status
make: *** [out/host/linux-x86/obj/lib/libEGL_translator.so] Error 1
make: *** Waiting for unfinished jobs....
解決方法:
下載i386版的libX11-dev.deb:i386,
1 提取 lib/libX11.a && libX11.so.6.3.0
2 復制到 /usr/lib32/
3 ln -s /usr/lib32/libX11.so.6.3.0 /usr/lib32/libX11.so
接下來就可以編譯了:
$ cd android/source
$ source build//usr/lib32/libX11.so
$ lunch full-eng
$ make -j4
等待漫長的編譯過程.
編譯時間太長了,機器檔次較低,用時256m54.955s
Install: out/target/product/generic/system/app/Settings.odex
Install: out/target/product/generic/system/app/Settings.apk
Finding NOTICE files: out/target/product/generic/obj/NOTICE_FILES/hash-timestamp
Combining NOTICE files: out/target/product/generic/obj/NOTICE.html
Installed file list: out/target/product/generic/installed-files.txt
Target system fs image: out/target/product/generic/obj/PACKAGING/systemimage_intermediates/system.img
Install system fs image: out/target/product/generic/system.img
real 178m30.719s
user 256m54.955s
sys 18m7.696s
啟動模擬器:
與以前不一樣:
$ emulator64-arm
啟動中..
更多Android相關信息見Android 專題頁面 http://www.linuxidc.com/topicnews.aspx?tid=11