GNU toolchain for RISC-V, including GCC
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Palmer Dabbelt f849e10ab4 Rename "--with-base-isa" to "--with-arch" 11 years ago
binutils binutils: fix default xlen setting 11 years ago
gcc gcc: accept --with-arch configure flag 11 years ago
glibc/sysdeps glibc: add missing pthread_spin_{init,destroy} 11 years ago
linux-headers/include linux-headers: Synchronize with UAPI split 11 years ago
newlib Disable newlib's dynamic rounding without F 11 years ago
patches gcc: merge libgcc makefiles for linux/elf targets 11 years ago
scripts Avoid wrapping GNU sed/awk on systems where that's the default 11 years ago
.gitignore Centralize GNU utility checks in autoconf 11 years ago
Makefile.in Rename "--with-base-isa" to "--with-arch" 11 years ago
README.md configure/Makefile: Add support for more options. 11 years ago
configure autoreconf 0ddf033f7202893f835df6199e4e903ece25b3fa 11 years ago
configure.ac Rename "--with-base-isa" to "--with-arch" 11 years ago

README.md

RISC-V GNU Compiler Toolchain

This is the RISC-V C and C++ cross-compiler. It supports two build modes: a generic ELF/Newlib toolchain and a more sophisticated Linux-ELF/glibc toolchain.

Author

Andrew Waterman

Contributors

  • Yunsup Lee
  • Quan Nguyen
  • Albert Ou
  • Darius Rad
  • Matt Thomas
  • ultraembedded (github id)

Prerequisites

Several standard packages are needed to build the toolchain. On Ubuntu, executing the following command should suffice:

$ sudo apt-get install autoconf automake autotools-dev libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo patchutils

On Mac OS, the source and build directories must live in a case-sensitive file system. The simplest approach is to create and mount a new disk image with that property. Make sure that the mount point does not contain spaces.

Installation (Newlib)

To build the Newlib cross-compiler, pick an install path. If you choose, say, /opt/riscv, then add /opt/riscv/bin to your PATH now. Then, simply run the following command:

./configure --prefix=/opt/riscv
make

You should now be able to use riscv-gcc and its cousins.

Installation (Linux)

To build the Linux cross-compiler, pick an install path. If you choose, say, /opt/riscv, then add /opt/riscv/bin to your PATH now. Then, simply run the following command:

./configure --prefix=/opt/riscv
make linux

Installation (Linux multilib)

To build the Linux cross-compiler with support for both 32-bit and 64-bit, run the following commands:

./configure --prefix=/opt/riscv --enable-multilib
make linux

The multilib compiler will have the prefix riscv-unknown-linux-gnu-, rather than the usual prefix (riscv32-... or riscv64-...).

Advanced Options

There are a number of additional options that may be passed to configure. See './configure --help' for more details.