为android构建Linux源代码后出错

时间:2011-03-19 15:56:27

标签: build-process android-emulator makefile linux-kernel cross-compiling

我已经为android编译了Linux内核源代码。构建源代码后出现错误,

之后
$ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
我得到了:

  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
 Kernel: arch/x86/boot/bzImage is ready  (#1)
  Building modules, stage 2.
  MODPOST 2283 modules
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'

所以我做了以下事情:

root@ubuntu:~/common# make CONFIG_DEBUG_SECTION_MISMATCH=y
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h

甚至在此之后我得到了相同的输出

root@ubuntu:~/common# make
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  SYMLINK include/asm -> include/asm-x86
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
Kernel: arch/x86/boot/bzImage is ready  (#3)
  Building modules, stage 2.
  MODPOST 2283 modules
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'

实际输出应为

 Kernel: arch/arm/boot/Image is ready
 Kernel: arch/arm/boot/zImage is ready

我也多次执行“make”命令,现在arch / arm / boot /目录中没有“image”。我尝试使用arch / x86 / boot中的映像运行模拟器,但这不起作用。它给了我一个错误。 实际命令是

./emulator -avd my_avd -kernel ~/common/arch/arm/boot/zImage -show-kernel -verbose

现在,因为我在/ arch / arm / boot中没有任何图像,我做了:

root@ubuntu:~/android-sdk-linux_x86/tools# ./emulator -avd avd1.5 -kernel ~/common/arch/x86/boot/bzImage -show-kernel -verbose

我收到了这个错误:

emulator: control console listening on port 5554, ADB on port 5555
emulator: can't connect to ADB server: Connection refused
emulator: ping program: /home/preetam/android-sdk-linux_x86/tools/ddms
emulator: ping command: /home/preetam/android-sdk-linux_x86/tools/ddms ping emulator 10.0
Unknown cp14 write op1:6 crn:0 crm:8 op2:6
qemu: fatal: Trying to execute code outside RAM or ROM at 0xff91c756

R00=00000000 R01=000005a1 R02=00000100 R03=00000000
R04=00000000 R05=00000000 R06=00000000 R07=00000000
R08=00000000 R09=00000000 R10=00000000 R11=00000000
R12=00000000 R13=00000000 R14=00010010 R15=ff91c756
PSR=400001f3 -Z-- T svc32
Aborted
root@ubuntu:~/android-sdk-linux_x86/tools# 

我不明白我做错了什么,我做了些蠢事,请有人告诉我怎样才能解决这个问题。 谢谢!

1 个答案:

答案 0 :(得分:1)

您可以尝试运行:

ARCH=arm CROSS_COMPILE=/path/to/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make CONFIG_DEBUG_SECTION_MISMATCH=y

因此make使用ARM设置运行

此外,您正在编译哪个内核版本?你从哪里得到这个内核?为什么不能直接使用Android项目中的内核?