enjoy-digital / litex

Build your hardware, easily!
Other
2.99k stars 567 forks source link

riscv64-unknown-gcc toolchain version 10.2.0-2020.12.8-x86_64-linux-centos error #1059

Closed aghaali-rs closed 2 years ago

aghaali-rs commented 3 years ago

I am using RISCV64 GCC toolchain version 10.2.0-2020.12.8 for centos 7. I was initially at commit 694878a35a2f792ad195ff9c585d689467a76b1d which worked fine however I recently switched to commit cb6861e1c81e154b953d33b69d2fe1490195185d and now i get the error in the attached screenshot.

toolchain error litex . I am using a prebuild from https://github.com/sifive/freedom-tools/releases However, when using version 8.3.0-2019.08.0 for Linux it works fine on centos 7.

kgugala commented 3 years ago

looks like there are some leftovers from previous builds. @aghaali-rs can you try a clean build?

aghaali-rs commented 3 years ago

A fresh install of LiteX and a fresh download of the prebuilt toolchain result in the error seen in the attached screenshot. fresh build error

kgugala commented 3 years ago

it seems to be a toolchain issue. It builds with this one https://static.dev.sifive.com/dev-tools/riscv64-unknown-elf-gcc-8.3.0-2020.04.1-x86_64-linux-ubuntu14.tar.gz

I'm also able to build it with riscv-toolchain installed from arch packages. The toolchain identifies itself with:

karol@karol:~$ riscv64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=riscv64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/riscv64-linux-gnu/10.2.0/lto-wrapper
Target: riscv64-linux-gnu
Configured with: /build/riscv64-linux-gnu-gcc/src/gcc-10.2.0/configure --prefix=/usr --program-prefix=riscv64-linux-gnu- --with-local-prefix=/usr/riscv64-linux-gnu --with-sysroot=/usr/riscv64-linux-gnu --with-build-sysroot=/usr/riscv64-linux-gnu --libdir=/usr/lib --libexecdir=/usr/lib --target=riscv64-linux-gnu --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --with-system-zlib --with-isl --with-linker-hash-style=gnu --disable-nls --disable-libunwind-exceptions --disable-libstdcxx-pch --disable-libssp --disable-multilib --disable-werror --enable-languages=c,c++ --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-gnu-unique-object --enable-linker-build-id --enable-lto --enable-plugin --enable-install-libiberty --enable-gnu-indirect-function --enable-checking=release
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 10.2.0 (GCC) 

karol@karol-o:~$ riscv64-linux-gnu-gcc --version
riscv64-linux-gnu-gcc (GCC) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Looks like the latest prebuilts from SiFive do not work with picolibc - I'd suggest changing the compiler.

akioolin commented 3 years ago

Hi,

In my current system. the SiFive prebuild gnu cross gcc toolchain 10.1.0 could work very well in CFU-Playground which is enabled picolibc support.

https://static.dev.sifive.com/dev-tools/freedom-tools/v2020.08/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14.tar.gz

BR, Akio

aghaali-rs commented 3 years ago

I tried the following four different versions of the toolchain:

Out of these four versions both 10.2.0 versions (centos6 and ubuntu14) had the same error however both 10.1.0 versions are working fine.

enjoy-digital commented 2 years ago

The issue seems related to the 10.2 toolchain and a working toolchain should be used.