chipsalliance / Cores-VeeR-EL2

VeeR EL2 Core
https://chipsalliance.github.io/Cores-VeeR-EL2/html/main/docs_rendered/html/index.html
Apache License 2.0
238 stars 70 forks source link

Make failed, `Unavailable multilib` #132

Closed wplf closed 8 months ago

wplf commented 8 months ago

Hi, there, I encounter a make bug when following the instruction in README.

System version: Ubuntu 22.04 Instruction: make in the tools directory. riscv-tool-chain version: decompressed the release version in https://github.com/riscv-collab/riscv-gnu-toolchain , the download link is https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/2023.11.08/riscv64-elf-ubuntu-22.04-gcc-nightly-2023.11.08-nightly.tar.gz

The make log:

...
Checking if "packed structs may contain bitfields" compiles: YES
Checking if "has __builtin_mul_overflow" : links: YES
Checking if "has __builtin_add_overflow" : links: YES
Checking if "supports _Complex" compiles: YES
Checking if "supports __builtin_complex" compiles: YES
Checking if "has __builtin_expect" : links: YES
Compiler for C supports arguments -Werror: YES
Checking if "attribute __alloc_size__" compiles: YES
Checking if "attributes constructor/destructor" compiles: YES
Message: target .;

meson.build:975:1: ERROR: Problem encountered: Unavailable multilib: rv32imac/ilp32

A full log can be found at /mnt/d/WPLF/Cores-VeeR-EL2/third_party/picolibc/build/meson-logs/meson-log.txt
make[1]: *** [/mnt/d/WPLF/Cores-VeeR-EL2/tools/picolibc.mk:44: /mnt/d/WPLF/Cores-VeeR-EL2/third_party/picolibc/install/picolibc.specs] Error 1
make[1]: Leaving directory '/mnt/d/WPLF/Cores-VeeR-EL2/tools'
make: *** [Makefile:195: picolibc] Error 2

The detailed log in meson-logs/meson-log.txt:

Compiler stderr:

Checking if "attribute __alloc_size__" compiles: YES
Running compile:
Working directory:  /mnt/d/WPLF/Cores-VeeR-EL2/third_party/picolibc/build/meson-private/tmpa7x3legv
Command line:  riscv64-unknown-elf-gcc /mnt/d/WPLF/Cores-VeeR-EL2/third_party/picolibc/build/meson-private/tmpa7x3legv/testfile.c -o /mnt/d/WPLF/Cores-VeeR-EL2/third_party/picolibc/build/meson-private/tmpa7x3legv/output.obj -c -msave-restore -D_FILE_OFFSET_BITS=64 -O0 -std=c18 -nostdlib -Werror

Code:

void __attribute__((constructor(101))) ctor (void) {}
void __attribute__((destructor(101))) dtor (void) {}

Compiler stdout:

Compiler stderr:

Checking if "attributes constructor/destructor" compiles: YES
Running command: /mnt/d/WPLF/riscv/bin/riscv64-unknown-elf-gcc -msave-restore --print-multi-lib
--- stdout ---
.;

--- stderr ---

Message: target .;

meson.build:975:1: ERROR: Problem encountered: Unavailable multilib: rv32imac/ilp32

I suppose this is because of the wrong riscv tool-chain version. How can I fix this?

Thank you very much and have a nice day.

tmichalak commented 8 months ago

Hi @wplf, the error message is saying that the cross-compiler or toolchain you're using doesn't have support for the 32-bit RISC-V architecture with the specified ISA extensions and ABI. This might mean you need to configure your toolchain with the proper multilib support as described in the Installation (Newlib/Linux multilib) section of the README. The nightly release packages in https://github.com/riscv-collab don't seem to be built with the multilib support.

tmichalak commented 8 months ago

@wplf I am guessing downloading the right compiler fixed your problem. Closing this issue, but feel free to reopen if there is anything unclear here.