Linux内核运行稀疏失败 - / bin / sh:1:稀疏:未找到

时间:2013-08-09 01:48:11

标签: linux-kernel

我在linux内核上运行稀疏。

但它会引发以下错误:

  

在linux上运行稀疏:
  lovegcy @ knltest-VirtualBox:〜/ git_root / linux $ make C = 2
  make [1]:“全部”没有什么可做的     HOSTCC arch / x86 / tools / relocs_32.o
    HOSTCC arch / x86 / tools / relocs_64.o
    HOSTCC arch / x86 / tools / relocs_common.o
    HOSTLD arch / x86 / tools / relocs
    CHK包含/ generated / uapi / linux / version.h
    CHK包括/ generated / utsrelease.h
    CC kernel / bounds.s
    GEN包含/ generated / bounds.h
    CC arch / x86 / kernel / asm-offsets.s
    GEN include / generated / asm-offsets.h
    CALL脚本/ checksyscalls.sh
    检查脚本/ mod / empty.c
   / bin / sh:1:稀疏:未找到
  make [2]: * [scripts / mod / empty.o]错误127
  make [1]:
[scripts / mod]错误2
  make:*
* [scripts]错误2

这是稀疏安装日志:

  

lovegcy @ knltest-VirtualBox:〜/ git_root / sparse $ make install
  / bin / sh:1:llvm-config:未找到
  Makefile:79:你的系统没有llvm,禁用sparse-llvm
       安装'稀疏' - > “/家/ lovegcy /斌/疏”
       安装'cgcc' - > “/家/ lovegcy /斌/总商会的
       安装'c2xml' - > “/家/ lovegcy /斌/ c2xml”
       安装'test-inspect' - > “/家/ lovegcy /斌/测试检查”
       安装'sparse.1' - > “/home/lovegcy/share/man/man1/sparse.1”
       安装'cgcc.1' - > “/home/lovegcy/share/man/man1/cgcc.1”
       安装'libsparse.a' - > “/home/lovegcy/lib/libsparse.a”
       安装'token.h' - > “/home/lovegcy/include/sparse/token.h”
       安装'parse.h' - > “/home/lovegcy/include/sparse/parse.h”
       安装'lib.h' - > “/home/lovegcy/include/sparse/lib.h”
       安装'symbol.h' - > “/home/lovegcy/include/sparse/symbol.h”
       安装'scope.h' - > “/home/lovegcy/include/sparse/scope.h”
       安装'expression.h' - > “/home/lovegcy/include/sparse/expression.h”
       安装'target.h' - > “/home/lovegcy/include/sparse/target.h”
       安装'linearize.h' - > “/home/lovegcy/include/sparse/linearize.h”
       安装'bitmap.h' - > “/home/lovegcy/include/sparse/bitmap.h”
       安装'ident-list.h' - > “/home/lovegcy/include/sparse/ident-list.h”
       安装'compat.h' - > “/home/lovegcy/include/sparse/compat.h”
       安装'flow.h' - > “/home/lovegcy/include/sparse/flow.h”
       安装'allocate.h' - > “/home/lovegcy/include/sparse/allocate.h”
       安装'storage.h' - > “/home/lovegcy/include/sparse/storage.h”
       安装'ptrlist.h' - > “/home/lovegcy/include/sparse/ptrlist.h”
       安装'dissect.h' - > “/home/lovegcy/include/sparse/dissect.h”
       安装'sparse.pc' - > '/home/lovegcy/lib/pkgconfig/sparse.pc'

更多: 内核已经编译好了。

有人能提供一些线索吗?

非常感谢!

1 个答案:

答案 0 :(得分:5)

更简单的方法:

首先,从官方频道下载并安装主机-PC上的 sparse

例如,在Ubuntu上运行,
$ sudo apt-get install sparse


从源代码构建:

或者,如果您尝试从其来源构建sparse,那么我们需要确保在运行make install命令后,sparse二进制文件存在于/usr/bin/sparse

这可以通过打开一个新终端并在其中运行which sparse命令来确认。它应该输出类似于以下内容:

$ which sparse
/usr/bin/sparse

在同一个终端中,导航到Linux内核源目录并尝试make C=2在Linux内核源代码上运行sparse

注意:从您的日志中可以看到sparse已安装到/home/lovegcy/bin/。确保您已添加路径/home/lovegcy/bin/ $PATH环境变量。否则系统将无法找到sparse二进制文件。

在Ubuntu(运行bash shell)上,通过在.bashrc文件中添加以下行,可以为每个新终端自动执行此操作,如下所示:

$ echo "export PATH=\$PATH:/home/lovegcy/bin/" >> ~/.bashrc