0
votes

I am trying to compile the linux kernel for riscv64 using the following link -

https://risc-v-getting-started-guide.readthedocs.io/en/latest/linux-qemu.html

While building linux with the command make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- defconfig the following error shows up - scripts/kconfig.include:35 compiler riscv64-unknown-linux-gnu-gcc not found in PATH scripts/kconfig/Makefile:82:recipe for target 'defconfig' failed

I have included path of tool chain. Still not working. Attached the screenshot of folder structure and error.enter image description here

1
Have you tried using the package manager to install qemu? Full installations come with riscv-system-riscv32 and 64 variants.Dylan McNamee

1 Answers

0
votes

I would suggest to provide the full prefix for your toolchain in the make command, for example:

wget https://toolchains.bootlin.com/downloads/releases/toolchains/riscv64/tarballs/riscv64--glibc--bleeding-edge-2020.02-2.tar.bz2
mkdir -p /opt/bootlin
tar jxf riscv64--glibc--bleeding-edge-2020.02-2.tar.bz2 -C /opt/bootlin

make ARCH=riscv CROSS_COMPILE=/opt/bootlin/riscv64--glibc--bleeding-edge-2020.02-2/bin/riscv64-buildroot-linux-gnu- mrproper defconfig Image 

Compilation should complete without errors - using linux 5.7.11 here:

  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  HOSTCC  scripts/kconfig/confdata.o
  HOSTCC  scripts/kconfig/expr.o
  LEX     scripts/kconfig/lexer.lex.c
  YACC    scripts/kconfig/parser.tab.[ch]
  HOSTCC  scripts/kconfig/lexer.lex.o
  .../...
  LD      vmlinux.o
  MODPOST vmlinux.o
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
  LD      .tmp_vmlinux.kallsyms1
  KSYM    .tmp_vmlinux.kallsyms1.o
  LD      .tmp_vmlinux.kallsyms2
  KSYM    .tmp_vmlinux.kallsyms2.o
  LD      vmlinux
  SYSMAP  System.map
  OBJCOPY arch/riscv/boot/Image
  Kernel: arch/riscv/boot/Image is ready