FirmwareRootkits
FirmwareRootkits

Reputation: 131

Building riscv-gnu-toolchain

I'm building the riscv-gnu-toolchain here: https://github.com/riscv-collab/riscv-gnu-toolchain like this:

 git clone https://github.com/riscv/riscv-gnu-toolchain.git
 cd riscv-gnu-toolchain
 git submodule update --init --recursive
 export RISCV=/opt/riscv
 ./configure --prefix="${RISCV}" --enable-multilib
 make linux

When compiling during the build of gcc I get this error:

/mnt/data/opt/riscv/sysroot/usr/include/gnu/stubs.h:8:11: fatal error:
gnu/stubs-ilp32.h: No such file or directory
    8 | # include <gnu/stubs-ilp32.h>
      |           ^~~~~~~~~~~~~~~~~~~

I have glibc-devel.i686 and glibc-devel.x86_64 installed on CentOS Stream 8. It's a new install and all up to date. I did follow the instructions and installed the prerequisites.

I think there is something I'm missing in the prerequisites (not listed). Can someone point out what that might be?

I do need to enable multilib since this is for seL4. Here: https://docs.sel4.systems/Hardware/spike.html

Upvotes: 2

Views: 2564

Answers (1)

FirmwareRootkits
FirmwareRootkits

Reputation: 131

I was able to get this to build with the exact steps above:

 git clone https://github.com/riscv/riscv-gnu-toolchain.git
 cd riscv-gnu-toolchain
 git submodule update --init --recursive
 export RISCV=/opt/riscv
 ./configure --prefix="${RISCV}" --enable-multilib
 make linux

What I did differently is not building newlib first. I use both versions of toolchain--one with newlib and one with glibc. I guess some left over configs from newlib cause this error.

I wiped out my /opt/riscv directory and the local git repo. I recloned and followed the above steps. It builds after that.

Upvotes: 1

Related Questions