I got an error shown on the terminal as the title, and the following errors in the config.log file, when I tried to install riscv tool chain:
configure:2638: $? = 0
configure:2627: riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32 -v >&5
Using built-in specs.
COLLECT_GCC=riscv64-unknown-linux-gnu-gcc
Target: riscv64-unknown-linux-gnu
Configured with: /home/sel4/riscv-gnu-toolchain/gcc/configure --target=riscv64-unknown-linux-gnu --prefix= --with-sysroot=/sysroot --with-newlib --without-headers --disable-shared --disable-threads --with-system-zlib --enable-tls --enable-languages=c --disable-libatomic --disable-libmudflap --disable-libssp --disable-libquadmath --disable-libgomp --disable-nls --disable-bootstrap --src=.././gcc --enable-multilib --with-abi=lp64d --with-arch=rv64imafdc --with-tune=rocket --with-isa-spec=20191213 'CFLAGS_FOR_TARGET=-O2 -mcmodel=medlow' 'CXXFLAGS_FOR_TARGET=-O2 -mcmodel=medlow'
Thread model: single
Supported LTO compression algorithms: zlib
gcc version 12.2.0 (GCC)
configure:2638: $? = 0
configure:2627: riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32 -V >&5
riscv64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-V'
riscv64-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:2638: $? = 1
configure:2627: riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32 -qversion >&5
riscv64-unknown-linux-gnu-gcc: error: unrecognized command-line option '-qversion'; did you mean '--version'?
riscv64-unknown-linux-gnu-gcc: fatal error: no input files
compilation terminated.
configure:2638: $? = 1
configure:2643: checking for suffix of object files
configure:2665: riscv64-unknown-linux-gnu-gcc -march=rv32imac -mabi=ilp32 -c -mcmodel=medlow -O2 -march=rv32imac -mabi=ilp32 conftest.c >&5
riscv64-unknown-linux-gnu-gcc: fatal error: cannot execute 'cc1': execvp: No such file or directory
compilation terminated.
configure:2669: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "GNU C Library"
| #define PACKAGE_TARNAME "glibc"
| #define PACKAGE_VERSION "(see version.h)"
| #define PACKAGE_STRING "GNU C Library (see version.h)"
| #define PACKAGE_BUGREPORT "https://sourceware.org/bugzilla/"
| #define PACKAGE_URL "https://www.gnu.org/software/glibc/"
| #define PKGVERSION "(GNU libc) "
| #define REPORT_BUGS_TO "<https://www.gnu.org/software/libc/bugs.html>"
| /* end confdefs.h. */
|
| int
| main ()
| {
|
| ;
| return 0;
| }
configure:2683: error: in `/home/sel4/riscv-gnu-toolchain/build-glibc-linux-rv32imac-ilp32':
Here are my configuration commands:
% mkdir /opt/riscv
% export RISCV=/opt/riscv
% ./configure --prefix="${RISCV}" --enable-multilib
I have tried to export LD_LIBRARY_PATH as /usr/local/lib, since i found a solution saying that the shared libraries may not be included. I also tried installing glibc package, since the log file mentioned this in the log file. But none of them works.
I am new to this environment and I'm not sure if there is anything missing. I would appreciate for any help.
Thanks in advance.