分页: 1 / 1

内核编译问题

发表于 : 2016-06-08 10:14
ubuntubirduser
root@zhang-ThinkPad-T60p:/usr/src/linux-2.6.38# make zImage
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
/usr/src/linux-2.6.38/./Kbuild:35: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:956: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
root@zhang-ThinkPad-T60p:/usr/src/linux-2.6.38#


以上是编译时产生的错误。
电脑系统:ubuntu16.04 ;
菜鸟初学
系统内核是linux-4.4.0;
要编译的内核是linux2.6.38;
工具:arm-none-linux-gnueabi-gcc,~ -v测试版本显示正常,说明安装没问题;
改了makefile的ARCH ?=arm;
CROSS_COMPILR ?=arm-linux-;
其他没变,然后make menuconfig配置了一点内容一变产生.config文件。
然后直接make zImage就出错;
但是我编译linux4.4.0不会出错。且可以生存zImage镜像。
请问大神们,究竟错在哪了?

Re: 内核编译问题

发表于 : 2016-06-08 10:52
astolia
CROSS_COMPILE 而非 CROSS_COMPILR

Re: 内核编译问题

发表于 : 2016-06-08 10:59
ubuntubirduser
这个错找到了,是arm-none-linux-gnueabi-gcc不是默认的gcc工具,用update-alternatives设置就好了,可有有新的错误。
scripts/mod/mk_elfconfig: 1: scripts/mod/mk_elfconfig: Syntax error: word unexpected (expecting ")")
/usr/src/linux-2.6.38/scripts/mod/Makefile:14: recipe for target 'scripts/mod/elfconfig.h' failed
make[2]: *** [scripts/mod/elfconfig.h] Error 2
scripts/Makefile.build:385: recipe for target 'scripts/mod' failed
make[1]: *** [scripts/mod] Error 2
Makefile:487: recipe for target 'scripts' failed
make: *** [scripts] Error 2

在scripts/mod/文件夹下明明有elfconfig.h文件,但打开是空文件,什么也没写