邮箱:zhuimengcanyang@163.com 痴爱嵌入式技术的蜗牛
分类: 嵌入式
2015-06-28 23:04:52
编译内核出现错误
输入:
make bzImage
出现错误提示: cc1: error: unrecognised debug output level "dwarf2"
[root@localhost linux-2.6.22.6]# make bzImage
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CALL scripts/checksyscalls.sh
<stdin>:91:1: warning: "__IGNORE_sync_file_range" redefined
In file included from <stdin>:2:
include/asm/unistd.h:444:1: warning: this is the location of the previous definition
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
CHK include/linux/compile.h
AS usr/initramfs_data.o
cc1: error: unrecognised debug output level "dwarf2"
make[1]: *** [usr/initramfs_data.o] Error 1
make: *** [usr] Error 2
(1)解决方法1:
----------------------------------------------------------------------
网上搜了下,是GCC版本不支持-gdwarf2
打开Makefile发下有这个参数
ifdef CONFIG_DEBUG_INFO
CFLAGS += -g
AFLAGS += -gdwarf2
endif
复制代码讲参数去掉后即可
#ifdef CONFIG_DEBUG_INFO
#CFLAGS += -g
#AFLAGS += -gdwarf2
#endif
(2)解决方法2:GCC版本太老了。
-------------------------------------------------------------------------------
GCC的版本太老了,你的gcc太老了,这年头使用的debug info格式都是gdwarf2了
查了一下自己的GCC版本:
[root@localhost linux-2.6.22.6]# gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=i386-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)