下面内容来自百度知道:

http://zhidao.baidu.com/link?url=Gi4YXjeKjht31bQO5XpJewVLbM8eA8zidHYadGDnT4-MHO6NNZMbdHWX3aJaAGJ9bn7Ko6-OYzYnRrIOl_sgcrfd7VqNQhVcIYu4JnN9ww7


在linux2.6.39内核中,Makefile中196行处 CROSS_COMPILE   ?= $(CONFIG_CROSS_COMPILE:"%"=%)

这句什么意思,主要就是这两个%号没看懂

回答:

:"%"=%
是一种字符串处理的模式匹配方式, 作用是取CONFIG_CROSS_COMPILE 定义中有"" 括起来的数据值,如

CONFIG_CROSS_COMPILE="arm-none-linux-gnueabi-"
则取出来的值即为arm-none-linux-gnueabi-,就是交叉编译器前缀。
CONFIG_CROSS_COMPILE,通常由make menuconfig 配置时设定,保存如 arm 配置保存在arch/arm/xxx_defconfig中

--------------------------------------------------------------------------------------------------------------------------

上面的内容是因为make zImage发生如下错误:

1. build linux kernel的错误
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mabi=aapcs-linux"
cc1: error: unrecognized command line option "-mno-thumb-interwork"
arch/arm/kernel/asm-offsets.c:1: error: bad value (armv5t) for -march= switch
arch/arm/kernel/asm-offsets.c:1: error: bad value (strongarm) for -mtune= switch


原因是CROSS_COMPILER路径没有设置正确
make ARCH=arm CROSS_COMPILE=~/<android source>/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-



Logo

更多推荐