当下已成功安装好toolchain,在生成linux kernel时,有如下操作
$ 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 exit with failure的问题:
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-
此时,遇到make error:
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
跪求各位大神提出解决方案,谢谢!