您的位置:首页 > 移动开发 > Android开发

Notes about compiling android kernel source on Mac OS Lion

2013-04-05 16:32 162 查看
Simply following google's official online documentation can't build the android kernel source easily, here are some notes to build it succeed, all is from my own experiments and testing.

1. "elf xxx" error as below:



The solution is about adding a "elf.h" file, and some slight changes on another 2 files:

Step1: add a file: "elf.h" to /kernel repository/scripts/mod/

Step2: change #include <elf.h> to #include "elf.h" in the following files in /kernel repository/scripts/mod/: mk_elfconfig.c and modpost.h

2. Toolchan issue, the google's doc says we should use "
export PATH=$(pwd)/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin:$PATH
" before building, but it doesn't say it is for linux:) Luckly, if you look into the source code folder structure "prebuilts", you'll find something about "darwin", that's about mac os!!!, so we should replace the "linux-x86" with "darwin-x86".

Finally the compiler is happy, and we get the goldfish emulator work with my kernel:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: