现象

系统本来可以正常编译linux系统kernel,但在安装svn后,kernel编译出错。

  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CALL    scripts/checksyscalls.sh
  CHK     include/generated/compile.h
gcc: directory: No such file or directory
gcc: directory": No such file or directory
<command-line>:0: warning: missing terminating " character
gcc: directory: No such file or directory
gcc: directory": No such file or directory
<command-line>:0: warning: missing terminating " character
gcc: directory: No such file or directory
gcc: directory": No such file or directory
<command-line>:0: warning: missing terminating " character
  CC      drivers/gpu/mali/mali/common/mali_kernel_core.o

arm-eabi-gcc: error: ": No such file or directory
make[4]: *** [drivers/gpu/mali/mali/common/mali_kernel_core.o] 错误 1
make[3]: *** [drivers/gpu/mali/mali] 错误 2
make[2]: *** [drivers/gpu/mali] 错误 2
make[1]: *** [drivers/gpu] 错误 2
make: *** [drivers] 错误 2
make: *** 正在等待未完成的任务....

原因分析

定位到 drivers/gpu/mali/ump/Makefile.commondrivers/gpu/mali/mali/Makefile 两个文件中都有关于SVN_REV:=xxxx的语句,正常情况下SVN_REV:=为空,当检查到svn版本后,SVN_REV:=有了值,导致脚本中判断走入错误分支。

解决方法

将两个文件中的SVN_REV值都赋值为空“”即可。

drivers/gpu/mali/ump/Makefile.common:

 16 # Get subversion revision number, fall back to 0000 if no svn info is available
 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: //')
 19 SVN_REV:=""

drivers/gpu/mali/mali/Makefile:

117 #SVN_REV := $(shell (cd $(DRIVER_DIR); (svnversion | grep -qv exported && svnversion) || git svn info | grep '^Revision: '| sed -e 's/        ^Revision: //' ) 2>/dev/null )
119 SVN_REV := ""

欢迎关注我的微信公众号【数据库内核】:分享主流开源数据库和存储引擎相关技术。

欢迎关注公众号数据库内核

标题网址
GitHubhttps://dbkernel.github.io
知乎https://www.zhihu.com/people/...
思否(SegmentFault)https://segmentfault.com/u/db...
掘金https://juejin.im/user/5e9d3e...
CSDNhttps://blog.csdn.net/dbkernel
博客园(cnblogs)https://www.cnblogs.com/dbkernel

dbkernel
33 声望7 粉丝

目前从事云数据库MySQL数据库内核研发工作,曾做过Postgres-XC、Greenplum等分布式数据库的内核开发。热衷于研究主流数据库架构、源码,对关系型数据库 MySQL/PostgreSQL及分布式数据库有深入研究。