Open candasunal opened 4 years ago
riscv-tools is poorly maintained. It is best to avoid it if you don't absolutely need it. And if you do need it, you might consider building the submodules individually instead of using riscv-tools, because riscv-tools has badly out of date and broken 2 year old versions of some of its submodules.
The error comes from passing riscv compiler options to an x86_64 compiler which obviously doesn't accept them. You need to build and install an riscv64-unknown-elf-gcc before you can build riscv-tools. The compiler is in riscv-gnu-toolchain. Or alternatively, you can download a pre-built one. SiFive has its toolchain, and some 3rd party toolchains, available for download from its website. See https://sifive.com/software
What @jim-wilson said is maybe true, you need to compile all the components separately. For the error which is due to riscv-pk, I was able to remove it and compile it perfectly by following the follow steps:
export example1=/path/to/bin/of/toolchain
export example2=/path/to/toolchain
export PATH="$example1:$PATH"
export PATH="$example2:$PATH"
Hope this helps. If you have any more issues, do reach out. Thanks.
Hello all,
I encounter a problem with the riscv tools installation. Before installation I updated my Ubuntu on my Windows by
sudo apt-get update -y
I want to go step by step to see if I miss something just in case.First I make my own directory under my username: /home/candasunal/ :
mkdir riscv
Then :
cd riscv/
Then I clone the git:
git clone https://github.com/riscv/riscv-tools.git
. Here is the result:I change my directory:
cd riscv-tools
Then I copy the code in Quickstart at https://github.com/riscv/riscv-tools :
git submodule update --init --recursive
. Here is the result:And then I install the neede packages:
sudo apt-get install autoconf automake autotools-dev curl libmpc-dev libmpfr-dev libgmp-dev libusb-1.0-0-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev device-tree-compiler pkg-config libexpat-dev
. Since I have done this install before, I got zero update. The result is:I go back to the riscv directory, create a new folder as toolchain, go back to riscv-tools folder and use the export command:
cd ..
mkdir toolchain
cd riscv-tools/
export RISCV=/home/candasunal/riscv/toolchain
Then I start the building by ./build.sh. Here come the warnings and errors, after the line at
Building project riscv-openocd
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'. libtoolize: copying file 'build-aux/ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'. libtoolize: copying file 'm4/libtool.m4' libtoolize: copying file 'm4/ltoptions.m4' libtoolize: copying file 'm4/ltsugar.m4' libtoolize: copying file 'm4/ltversion.m4' libtoolize: copying file 'm4/lt~obsolete.m4' configure.ac:42: installing 'build-aux/ar-lib' configure.ac:37: installing 'build-aux/compile' configure.ac:28: installing 'build-aux/config.guess' configure.ac:28: installing 'build-aux/config.sub' configure.ac:30: installing 'build-aux/install-sh' configure.ac:30: installing 'build-aux/missing' Makefile.am: installing './INSTALL' libjaylink/Makefile.am: installing 'build-aux/depcomp' libtoolize: putting auxiliary files in '.'. libtoolize: copying file './ltmain.sh' libtoolize: Consider adding 'AC_CONFIG_MACRO_DIRS([m4])' to configure.ac, libtoolize: and rerunning libtoolize and aclocal. libtoolize: Consider adding '-I m4' to ACLOCAL_AMFLAGS in Makefile.am. libtoolize: 'AC_PROG_RANLIB' is rendered obsolete by 'LT_INIT' configure.ac:26: installing './compile' configure.ac:37: installing './config.guess' configure.ac:37: installing './config.sub' configure.ac:16: installing './install-sh' configure.ac:16: installing './missing' Makefile.am:46: warning: wildcard $(srcdir: non-POSIX variable name Makefile.am:46: (probably a GNU make extension) Makefile.am: installing './INSTALL' Makefile.am: installing './depcomp' Makefile.am:23: installing './mdate-sh' Makefile.am:23: installing './texinfo.tex' Configuring project riscv-openocd No installed jimsh or tclsh, building local bootstrap jimsh0 Building project riscv-openocd Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' ar:
u' modifier ignored since
D' is the default (seeU') Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') ar:u' modifier ignored since
D' is the default (seeU') ar:
u' modifier ignored sinceD' is the default (see
U') Installing project riscv-openocd Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive' Makefile:4509: warning: overriding recipe for target 'check-recursive' Makefile:3920: warning: ignoring old recipe for target 'check-recursive'Configuring project riscv-isa-sim Building project riscv-isa-sim ../spike_main/disasm.cc: In constructor ‘disassembler_t::disassembler_t(int)’: ../spike_main/disasm.cc:275:1: note: variable tracking size limit exceeded with -fvar-tracking-assignments, retrying without disassembler_t::disassembler_t(int xlen) ^
~~~~~ Installing project riscv-isa-sim mkdir /home/candasunal/riscv/toolchain/include mkdir /home/candasunal/riscv/toolchain/include/fesvr mkdir /home/candasunal/riscv/toolchain/lib mkdir /home/candasunal/riscv/toolchain/lib/pkgconfigConfiguring project riscv-pk Building project riscv-pk gcc: error: unrecognized argument in option ‘-mcmodel=medany’ gcc: note: valid arguments to ‘-mcmodel=’ are: 32 kernel large medium small; did you mean ‘medium’? make: *** [file.o] Error 1