riscv |
03-24-2017 10:04 AM |
Hello,
Apparently even when i installed g++ it was still appearing as not installed. So i reinstalled it and it worked. But i still have errors related to gcc (libiberty for example).
The riscv-tools directory looks like this:
Code:
build.common build.sh build-spike-pk.sh regression.sh riscv-fesvr riscv-isa-sim riscv-opcodes riscv-tests
build-rv32ima.sh build-spike-only.sh README.md riscv riscv-gnu-toolchain riscv-llvm riscv-pk
I'm trying to install the riscv-gnu-toochain which looks like this:
Code:
bin build-binutils-newlib config.log configure hello.c lib linux-headers Makefile.in riscv64-unknown-elf riscv-dejagnu riscv-glibc scripts src
build build-gcc-newlib config.status configure.ac include LICENSE Makefile README.md riscv-binutils-gdb riscv-gcc riscv-newlib share stamps
So i run the following from the riscv-tools directory:
Code:
git submodule update --init --recursive
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils
export TOP=$(pwd)
export RISCV=$TOP/riscv
export PATH=$PATH:$RISCV/bin
export MAKEFLAGS="$MAKEFLAGS -j5"
./build.sh
Now, the ./build.sh looks like this
Code:
#! /bin/bash
#
# Script to build RISC-V ISA simulator, proxy kernel, and GNU toolchain.
# Tools will be installed to $RISCV.
. build.common
echo "Starting RISC-V Toolchain build process"
build_project riscv-fesvr --prefix=$RISCV
build_project riscv-isa-sim --prefix=$RISCV --with-fesvr=$RISCV
build_project riscv-gnu-toolchain --prefix=$RISCV
CC= CXX= build_project riscv-pk --prefix=$RISCV --host=riscv64-unknown-elf
build_project riscv-tests --prefix=$RISCV/riscv64-unknown-elf
echo -e "\\nRISC-V Toolchain installation completed!"
At the riscv-gnu-toolchain stage: it yields this error:
Code:
...
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/etc'
mkdir -p -- ./fixincludes
Configuring in ./fixincludes
configure: creating cache ./config.cache
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... riscv64-unknown-elf
checking for x86_64-pc-linux-gnu-gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for a sed that does not truncate output... /bin/sed
checking whether gcc supports -W... yes
checking whether gcc supports -Wall... yes
checking whether gcc supports -Wwrite-strings... yes
checking whether gcc supports -Wstrict-prototypes... yes
checking whether gcc supports -Wmissing-prototypes... yes
checking whether gcc supports -Wold-style-definition... yes
checking whether gcc supports -Wmissing-format-attribute... yes
checking whether gcc supports -Woverlength-strings... yes
checking whether gcc supports -pedantic -Wlong-long... yes
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking for strings.h... (cached) yes
checking for unistd.h... (cached) yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/file.h usability... yes
checking sys/file.h presence... yes
checking for sys/file.h... yes
checking for sys/stat.h... (cached) yes
checking for clearerr_unlocked... yes
checking for feof_unlocked... yes
checking for ferror_unlocked... yes
checking for fflush_unlocked... yes
checking for fgetc_unlocked... yes
checking for fgets_unlocked... yes
checking for fileno_unlocked... yes
checking for fprintf_unlocked... no
checking for fputc_unlocked... yes
checking for fputs_unlocked... yes
checking for fread_unlocked... yes
checking for fwrite_unlocked... yes
checking for getchar_unlocked... yes
checking for getc_unlocked... yes
checking for putchar_unlocked... yes
checking for putc_unlocked... yes
checking whether abort is declared... yes
checking whether asprintf is declared... yes
checking whether basename is declared... yes
checking whether errno is declared... no
checking whether vasprintf is declared... yes
checking whether clearerr_unlocked is declared... yes
checking whether feof_unlocked is declared... yes
checking whether ferror_unlocked is declared... yes
checking whether fflush_unlocked is declared... yes
checking whether fgetc_unlocked is declared... yes
checking whether fgets_unlocked is declared... yes
checking whether fileno_unlocked is declared... yes
checking whether fprintf_unlocked is declared... no
checking whether fputc_unlocked is declared... yes
checking whether fputs_unlocked is declared... yes
checking whether fread_unlocked is declared... yes
checking whether fwrite_unlocked is declared... yes
checking whether getchar_unlocked is declared... yes
checking whether getc_unlocked is declared... yes
checking whether putchar_unlocked is declared... yes
checking whether putc_unlocked is declared... yes
checking for an ANSI C-conforming const... yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking for mmap... yes
checking whether read-only mmap of a plain file works... yes
checking whether mmap from /dev/zero works... yes
checking for MAP_ANON(YMOUS)... yes
checking whether mmap with MAP_ANON(YMOUS) works... yes
checking whether to enable maintainer-specific portions of Makefiles... no
configure: updating cache ./config.cache
configure: creating ./config.status
config.status: creating Makefile
config.status: creating mkheaders.almost
config.status: creating config.h
make[3]: Entering directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/fixincludes'
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixincl.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixtests.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixfixes.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/server.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/procopen.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixlib.c
gcc -c -g -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute -Wno-overlength-strings -pedantic -Wno-long-long -DHAVE_CONFIG_H -I. -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes -I../include -I/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/../include /home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/src/newlib-gcc/fixincludes/fixopts.c
make[3]: *** No rule to make target '../libiberty/libiberty.a', needed by 'full-stamp'. Stop.
make[3]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib/fixincludes'
Makefile:3757: recipe for target 'all-fixincludes' failed
make[2]: *** [all-fixincludes] Error 2
make[2]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib'
Makefile:857: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/alpha/installation/rocket-chip/riscv-tools/riscv-gnu-toolchain/build-gcc-newlib'
Makefile:218: recipe for target 'stamps/build-gcc-newlib' failed
make: *** [stamps/build-gcc-newlib] Error 2
Also, since the everything is connected, when i run these commands in the riscv-pk directory, i get this error relative to gcc also:
Code:
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ ../configure --prefix=$RISCV --host=riscv64-unknown-elf
checking build system type... x86_64-unknown-linux-gnu
checking host system type... riscv64-unknown-elf
checking for riscv64-unknown-elf-gcc... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for riscv64-unknown-elf-g++... no
checking for riscv64-unknown-elf-c++... no
checking for riscv64-unknown-elf-gpp... no
checking for riscv64-unknown-elf-aCC... no
checking for riscv64-unknown-elf-CC... no
checking for riscv64-unknown-elf-cxx... no
checking for riscv64-unknown-elf-cc++... no
checking for riscv64-unknown-elf-cl.exe... no
checking for riscv64-unknown-elf-FCC... no
checking for riscv64-unknown-elf-KCC... no
checking for riscv64-unknown-elf-RCC... no
checking for riscv64-unknown-elf-xlC_r... no
checking for riscv64-unknown-elf-xlC... no
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for riscv64-unknown-elf-ar... riscv64-unknown-elf-ar
checking for riscv64-unknown-elf-ranlib... riscv64-unknown-elf-ranlib
checking for riscv64-unknown-elf-readelf... riscv64-unknown-elf-readelf
checking for riscv64-unknown-elf-objcopy... riscv64-unknown-elf-objcopy
checking for a BSD-compatible install... /usr/bin/install -c
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
configure: configuring default subproject : pk
configure: configuring default subproject : bbl
configure: configuring default subproject : softfloat
configure: configuring default subproject : dummy_payload
configure: configuring default subproject : machine
configure: configuring default subproject : util
configure: creating ./config.status
config.status: creating pk.mk
config.status: creating bbl.mk
config.status: creating softfloat.mk
config.status: creating dummy_payload.mk
config.status: creating machine.mk
config.status: creating util.mk
config.status: creating Makefile
config.status: creating config.h
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ make
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/file.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/syscall.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/handlers.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/frontend.c
gcc -MMD -MP -Wall -Werror -D__NO_INLINE__ -mcmodel=medany -O2 -std=gnu99 -Wno-unused -Wno-attributes -fno-delete-null-pointer-checks -DBBL_PAYLOAD=\"bbl_payload\" -I. -I../pk -I../bbl -I../softfloat -I../dummy_payload -I../machine -I../util -c ../pk/elf.c
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'frontend.o' failed
make: *** [frontend.o] Error 1
make: *** Waiting for unfinished jobs....
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'syscall.o' failed
make: *** [syscall.o] Error 1
Makefile:302: recipe for target 'handlers.o' failed
make: *** [handlers.o] Error 1
Makefile:302: recipe for target 'elf.o' failed
make: *** [elf.o] Error 1
gcc: error: unrecognized argument in option ‘-mcmodel=medany’
gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small
Makefile:302: recipe for target 'file.o' failed
make: *** [file.o] Error 1
and
Code:
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ CC=riscv64-unknown-elf-gcc ../configure --prefix=$path/riscv64-unknown-elf --host=riscv64-unknown-elf
alpha@alpha-VirtualBox:~/installation/rocket-chip/riscv-tools/riscv-pk/build$ CC=riscv64-unknown-elf-gcc ../configure --prefix=$path/riscv64-unknown-elf --host=riscv64-unknown-elf
checking build system type... x86_64-unknown-linux-gnu
checking host system type... riscv64-unknown-elf
checking for riscv64-unknown-elf-gcc... riscv64-unknown-elf-gcc
checking whether the C compiler works... no
configure: error: in `/home/alpha/installation/rocket-chip/riscv-tools/riscv-pk/build':
configure: error: C compiler cannot create executables
|