【问题标题】:When install riscv-linux environment, tar exit with failure and make ARCH=riscv error安装 riscv-linux 环境时,tar 退出失败并产生 ARCH=riscv 错误
【发布时间】:2017-07-20 09:09:44
【问题描述】:

这几天,我尝试在 Ubuntu 系统中安装 riscv 环境。根据页面https://github.com/riscv/riscv-tools,我安装工具链成功。

然后我尝试使用这种方式构建 Linux 内核:

$ cd $TOP
$ git clone https://github.com/riscv/riscv-linux.git linux-3.14.33
$ curl -L https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.33.tar.xz | tar -xJkf -

当我执行此行时,tar 存在失败,如下所示:

tar: linux-3.14.33/virt/kvm/arm/vgic.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/assigned-dev.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/async_pf.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/async_pf.h: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/coalesced_mmio.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/coalesced_mmio.h: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/eventfd.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/ioapic.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/ioapic.h: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/iodev.h: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/iommu.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/irq_comm.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/irqchip.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/kvm_main.c: Cannot open: File exists
tar: linux-3.14.33/virt/kvm/vfio.c: Cannot open: File exists
tar: Exiting with failure status due to previous errors

我忽略了这个失败,并执行了这个:

$ cd linux-3.14.33
$ make ARCH=riscv defconfig
$ make ARCH=riscv menuconfig
$ make -j8 ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu-

然后,出现了一些错误:

crypto/kpp.c: In function 'crypto_kpp_report':
crypto/kpp.c:31:27: error: storage size of 'rkpp' isn't known
  struct crypto_report_kpp rkpp;
                           ^~~~
crypto/kpp.c:35:19: error: 'CRYPTOCFGA_REPORT_KPP' undeclared (first use in this function); did you mean 'CRYPTOCFGA_REPORT_RNG'?
  if (nla_put(skb, CRYPTOCFGA_REPORT_KPP,
                   ^~~~~~~~~~~~~~~~~~~~~
                   CRYPTOCFGA_REPORT_RNG
crypto/kpp.c:35:19: note: each undeclared identifier is reported only once for each function it appears in
crypto/kpp.c:36:14: error: invalid application of 'sizeof' to incomplete type 'struct crypto_report_kpp'
       sizeof(struct crypto_report_kpp), &rkpp))
              ^~~~~~
crypto/kpp.c:31:27: warning: unused variable 'rkpp' [-Wunused-variable]
  struct crypto_report_kpp rkpp;
                           ^~~~
crypto/akcipher.c: In function 'crypto_akcipher_report':
crypto/akcipher.c:31:32: error: storage size of 'rakcipher' isn't known
  struct crypto_report_akcipher rakcipher;
                                ^~~~~~~~~
crypto/akcipher.c:35:19: error: 'CRYPTOCFGA_REPORT_AKCIPHER' undeclared (first use in this function); did you mean 'CRYPTOCFGA_REPORT_CIPHER'?
  if (nla_put(skb, CRYPTOCFGA_REPORT_AKCIPHER,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
                   CRYPTOCFGA_REPORT_CIPHER
crypto/akcipher.c:35:19: note: each undeclared identifier is reported only once for each function it appears in
crypto/akcipher.c:36:14: error: invalid application of 'sizeof' to incomplete type 'struct crypto_report_akcipher'
       sizeof(struct crypto_report_akcipher), &rakcipher))
              ^~~~~~
crypto/akcipher.c:31:32: warning: unused variable 'rakcipher' [-Wunused-variable]
  struct crypto_report_akcipher rakcipher;
                                ^~~~~~~~~
scripts/Makefile.build:302: recipe for target 'crypto/kpp.o' failed
make[1]: *** [crypto/kpp.o] Error 1
make[1]: *** Waiting for unfinished jobs....
scripts/Makefile.build:302: recipe for target 'crypto/akcipher.o' failed
make[1]: *** [crypto/akcipher.o] Error 1
crypto/acompress.c: In function 'crypto_acomp_report':
crypto/acompress.c:34:29: error: storage size of 'racomp' isn't known
  struct crypto_report_acomp racomp;
                             ^~~~~~
crypto/acompress.c:38:19: error: 'CRYPTOCFGA_REPORT_ACOMP' undeclared (first use in this function); did you mean 'CRYPTOCFGA_REPORT_AEAD'?
  if (nla_put(skb, CRYPTOCFGA_REPORT_ACOMP,
                   ^~~~~~~~~~~~~~~~~~~~~~~
                   CRYPTOCFGA_REPORT_AEAD
crypto/acompress.c:38:19: note: each undeclared identifier is reported only once for each function it appears in
crypto/acompress.c:39:14: error: invalid application of 'sizeof' to incomplete type 'struct crypto_report_acomp'
       sizeof(struct crypto_report_acomp), &racomp))
              ^~~~~~
crypto/acompress.c:34:29: warning: unused variable 'racomp' [-Wunused-variable]
  struct crypto_report_acomp racomp;
                             ^~~~~~
scripts/Makefile.build:302: recipe for target 'crypto/acompress.o' failed

感谢您的关注,期待您的回复。

【问题讨论】:

    标签: linux riscv


    【解决方案1】:

    众所周知,rocket-chip 的存储库使用了一个特定版本的 riscv-tools,它是另一个存储库。而在riscv-tools具体版本的首页,会有需要的Linux内核版本。

    实际上,工具链与硬件实现紧密相关。因此,我们必须使用rocket-chip中指定的唯一版本。

    使用git更新rocket-chip中的riscv-tools。

    git submodule update --init --recursive
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-06-27
      • 1970-01-01
      • 2015-07-17
      • 2014-10-29
      • 2020-04-03
      • 2023-03-14
      • 2022-06-12
      相关资源
      最近更新 更多