riscv-software-src / riscv-tools

RISC-V Tools (ISA Simulator and Tests)
1.13k stars 446 forks source link

risc-tools installation failed with previous tag #193

Closed hoangt closed 6 years ago

hoangt commented 6 years ago

@palmer-dabbelt

I checked out the old versions via their tags (priv-1.7, priv-1.9 etc.). Following installation steps,

$ git submodule update --init --recursive
$ export RISCV=/path/to/install/riscv/toolchain
$ ./build.sh

Error message occurred when riscv-gnu-toolchain was built. It has been fixed in commit "efa614e51" but it was not fixed for versions before that commit.

configure: error: Building GCC requires GMP 4.2+, MPFR 2.4.0+ and MPC 0.8.0+.
Try the --with-gmp, --with-mpfr and/or --with-mpc options to specify
their locations.  Source code for these libraries can be found at
their respective hosting sites as well as at
ftp://gcc.gnu.org/pub/gcc/infrastructure/.  See also
http://gcc.gnu.org/install/prerequisites.html for additional info.  If
you obtained GMP, MPFR and/or MPC from a vendor distribution package,
make sure that you have installed both the libraries and the header
files.  They may be located in separate packages.
make: *** [stamps/build-gcc-newlib] Error 1
jim-wilson commented 6 years ago

You can install the missing packages. The names depend on which OS/distro you are using, but is probably something like libgmp-dev, libmpfr-dev, and libmpc-dev. The "dev" might be "devel".

Or you can download sources for the packages and add them to your gcc tree, and they will be built as part of the gcc build.

If you are building really old versions of gcc, it is possible that current gmp/mpfr/mpc versions might not be compatible with it, and you might need to use old versions of them, which means you will need to use the approach of downloading old versions of their sources and adding them to your gcc tree.

The "fix" in the riscv-gnu-toolchain tree is to add source packages to the repo and makefile rules to download and unpack them. But this "fix" causes other problems, so it is best not to rely on it. I see no reason to backport this "fix" to other branches.