在编译内核时出现了如下错误:
init/built-in.o: In function `do_one_initcall':
calibrate.c:(.text+0x14): undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `init_post':
calibrate.c:(.text+0x1d4): undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `name_to_dev_t':
calibrate.c:(.text+0x358): undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `rest_init':
calibrate.c:(.ref.text+0x10): undefined reference to `__gnu_mcount_nc'
init/built-in.o: In function `calibrate_delay':
calibrate.c:(.cpuinit.text+0x10): undefined reference to `__gnu_mcount_nc'
arch/arm/kernel/built-in.o:io.c:(.text+0x10): more undefined references to `__gnu_mcount_nc' follow
make: *** [.tmp_vmlinux1] Error 1
上网参阅以下两个网页,
http://forum.ubuntu.org.cn/viewtopic.php?t=333083 http://blog.sina.com.cn/s/blog_7d3976fc01012itz.html 得出解决方法:在网上下载一个补丁文件:地址如下:
www.arm9home.net/job.php?action-download-pid-37009-tid-7318-aid-1431.html
方法一,下载到Linux内核目录下,然后gunzip -dc __gnu_mcount_nc_patch.patch.gz |patch -p1
方法二,下载之后放在linux根目录下,并解压得到:__gnu_mcount_nc_patch.patch 文件。
然后,在终端进入linux根目录,执行以下语句进行打包:
zcat __gnu_mcount_nc_patch.patch | patch p1 或者
(注意:“__”为两个下划线连在一起,“p1”后面的是阿拉伯数字1,还要注意空格)
再重新编译就好了。