嵌入式技术分享

Embedded Technology Sharing

嵌入式内核编译报错处理

《嵌入式内核编译报错处理》 执行编译
make zImage

内核源码第一次编译,会出现如下几项报错提示

报错1
报错内容
scripts/kconfig/conf –silentoldconfig Kconfig
***
*** Configuration file “.config” not found!
***
*** Please run some configurator (e.g. “make oldconfig” or
*** “make menuconfig” or “make xconfig”).
***
/home/cheng/iTOP4412/test/iTop4412_Kernel_3.0/scripts/kconfig/Makefile:33: recipe for target ‘silentoldconfig’ failed
make[2]: *** [silentoldconfig] Error 1
/home/cheng/iTOP4412/test/iTop4412_Kernel_3.0/Makefile:500: recipe for target ‘silentoldconfig’ failed
make[1]: *** [silentoldconfig] Error 2
make: *** No rule to make target ‘include/config/auto.conf’, needed by ‘include/config/kernel.release’。 停止。
报错截图
《嵌入式内核编译报错处理》
报错说明
没有配置.config
修改方法
cp config_for_linux_scp_supper .config

报错2
报错内容
kernel/printk.c: In function ‘setup_log_buf’:
kernel/printk.c:210: warning: unused variable ‘new_log_buf’
CC kernel/cpu.o
CC kernel/exit.o
CC kernel/itimer.o
TIMEC kernel/timeconst.h
Can’t use ‘defined(@array)’ (Maybe you should just omit the defined()?) at kernel/timeconst.pl line 373.
/home/cheng/iTOP4412/test/iTop4412_Kernel_3.0/kernel/Makefile:140: recipe for target ‘kernel/timeconst.h’ failed
make[1]: *** [kernel/timeconst.h] Error 255
Makefile:953: recipe for target ‘kernel’ failed
make: *** [kernel] Error 2
报错截图
《嵌入式内核编译报错处理》
解决方法:
kernel/timeconst.pl中第373行的defined()去掉只留下@val就可以了
cheng@vm-ubuntu:~/iTOP4412/iTop4412_Kernel_3.0$ vi kernel/timeconst.pl
《嵌入式内核编译报错处理》

报错3
报错内容:
arm-none-linux-gnueabi-gcc: 未版本控制: No such file or directory
arm-none-linux-gnueabi-gcc: 未版本控制“: No such file or directory
<command-line>:0: warning: missing terminating ” character
drivers/media/video/samsung/mali_ics/common/mali_kernel_core.c: In function ‘mali_kernel_constructor’:
drivers/media/video/samsung/mali_ics/common/mali_kernel_core.c:172: error: missing terminating ” character
drivers/media/video/samsung/mali_ics/common/mali_kernel_core.c:172: error: expected expression before ‘)’ token
scripts/Makefile.build:305: recipe for target ‘drivers/media/video/samsung/mali_ics/common/mali_kernel_core.o’ failed
make[5]: *** [drivers/media/video/samsung/mali_ics/common/mali_kernel_core.o] Error 1
scripts/Makefile.build:441: recipe for target ‘drivers/media/video/samsung/mali_ics’ failed
make[4]: *** [drivers/media/video/samsung/mali_ics] Error 2
scripts/Makefile.build:441: recipe for target ‘drivers/media/video/samsung’ failed
make[3]: *** [drivers/media/video/samsung] Error 2
scripts/Makefile.build:441: recipe for target ‘drivers/media/video’ failed
make[2]: *** [drivers/media/video] Error 2
scripts/Makefile.build:441: recipe for target ‘drivers/media’ failed
make[1]: *** [drivers/media] Error 2
Makefile:953: recipe for target ‘drivers’ failed
make: *** [drivers] Error 2
报错截图
《嵌入式内核编译报错处理》
报错原因:内核代码SVN版本控制问题,查找所有带SVN_REV的文件(Makefile),逐一进行修改。
查找命令:grep -rn SVN_REV
修改方式:在所有含SVN_REV语句最后尾Revision: //’添加: |sed -e ‘s/ /\\ /’
如:
未修改前
SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -Eqv “exported|Unversioned directory” && svnversion) || git svn info | grep ‘^Revision: ‘| sed -e ‘s/^Revision: //’ ) 2>/dev/null )
修改后
SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -Eqv “exported|Unversioned directory” && svnversion) || git svn info | grep ‘^Revision: ‘| sed -e ‘s/^Revision: //’ |sed -e ‘s/ /\\ /’ ) 2>/dev/null )

需要修改的相关文件
drivers/media/video/samsung/mali_ics/Makefile.common:43:SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -Eqv “exported|Unversioned directory” && svnversion) || git svn info | grep ‘^Revision: ‘| sed -e ‘s/^Revision: //’ ) 2>/dev/null )

drivers/media/video/samsung/mali_ics/Makefile:277:SVN_REV:=$(shell ((svnversion | grep -Eqv “exported|Unversioned directory” && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/media/video/samsung/ump_ics/Makefile_backup:76:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/media/video/samsung/ump_ics/Makefile:89:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/media/video/samsung/mali_gb/Makefile.common:40:SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -qv exported && svnversion) || git svn info | grep ‘^Revision: ‘| sed -e ‘s/^Revision: //’ ) 2>/dev/null )

drivers/media/video/samsung/mali_gb/Makefile:270:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/media/video/samsung/ump_gb/Makefile_backup:76:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/media/video/samsung/ump_gb/Makefile:88:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

drivers/gpu/vithar/ump/src/devicedrv/Makefile.common:17:SVN_REV:=$(shell ((svnversion | grep -qv exported && echo -n ‘Revision: ‘ && svnversion) || git svn info | sed -e ‘s/$$$$/M/’ | grep ‘^Revision: ‘ || echo ${MALI_RELEASE_NAME}) 2>/dev/null | sed -e ‘s/^Revision: //’)

修改完毕后,重新执行编译即可

如果文章对您有帮助,欢迎移至上方按钮打赏博主;

点赞

发表评论

电子邮件地址不会被公开。 必填项已用*标注