编译内核的时候.config和Makefile都有了之后。make一下出错了是怎么回事?

297 views
Skip to first unread message

高家升

unread,
May 27, 2012, 12:54:59 AM5/27/12
to 西邮Linux兴趣小组
编译内核的时候.config和Makefile都有了之后。make一下出错了是怎么回事?


已经生成了.config和Makefile。但是Make dep  ,Make ,make -j4全部有问题。错误信息如下:


[root@Gavin-Pc linux-3.3.7]# make
/usr/src/linux-3.3.7/scripts/gcc-version.sh: line 25: ygcc: command not found
/usr/src/linux-3.3.7/scripts/gcc-version.sh: line 26: ygcc: command not found
/usr/src/linux-3.3.7/arch/x86/Makefile:81: stack protector enabled but no compiler support
make: ygcc:命令未找到
make[1]: 对“all”无需做任何事。
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
  CC      kernel/bounds.s
/bin/sh: ygcc: command not found
make[1]: *** [kernel/bounds.s] 错误 127
make: *** [prepare0] 错误 2

--
Thinking.......

肥猫

unread,
May 27, 2012, 2:00:26 AM5/27/12
to 高家升, 西邮Linux兴趣小组
make: ygcc:命令未找到

我这里没这个错误。不过搜索了下,有些兄台有这个错误:

http://stackoverflow.com/questions/6517318/ygcc-command-not-found

Double check that you made sure to make menuconfig (or xconfig) it
seems that some variables aren't set correctly.

If you do make menuconfig and then just go and hit save .config file
then it should generate the default kernel compilation file with the
correct variables. – Jesus Ramos Jun 29 '11 at 7:54


========================================

这句有点意思:跨平台编译器变量设置错误:

Open the .config file to see if the CONFIG_CROSS_COMPILE variable is
set properly. From the error message, the most probable setting is
CONFIG_CROSS_COMPILE="y"

meaning that "y" is the prefix of your cross compiler. Thus, the build
system would use ygcc instead of gcc. Also, it will try to find
yobjdump instead of objdump.

就是用y加在了gcc前头,所以会使用ygcc,同样的会试图用yobjdump来替代objdump。

这个变量是用于跨平台编译的,如设置为CONFIG_CROSS_COMPILE="arm-linux-",那么她会执行arm-linux-gcc,这个。。。唔。。。

============================

反正重新配置就对了。

肥猫

unread,
May 27, 2012, 2:00:56 AM5/27/12
to 高家升, 西邮Linux兴趣小组

zhaoqiao

unread,
May 27, 2012, 8:25:40 AM5/27/12
to 肥猫, 高家升, 西邮Linux兴趣小组


2012/5/27 肥猫 <llz9...@yahoo.com.cn>


升升,你的.config文件是经过make menuconfig得到的么。。。?
还有个方法,就是你直接用你系统下boot下的那个config文件,将文件拷贝到你的源码中,并重命名,然后再试下。。。

肥猫

unread,
May 27, 2012, 8:31:42 AM5/27/12
to zhaoqiao, 高家升, 西邮Linux兴趣小组
make oldconfig
Reply all
Reply to author
Forward
0 new messages