Skip to content

Commit

Permalink
Merge pull request riscv-software-src#279 from riscv/toolchain
Browse files Browse the repository at this point in the history
Remove the toolchain in riscv-tools
  • Loading branch information
palmer-dabbelt authored Apr 2, 2019
2 parents bce7b5e + a924da5 commit 2619062
Show file tree
Hide file tree
Showing 12 changed files with 26,415 additions and 45 deletions.
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "riscv-isa-sim"]
path = riscv-isa-sim
url = https://github.com/riscv/riscv-isa-sim.git
[submodule "riscv-fesvr"]
path = riscv-fesvr
url = https://github.com/riscv/riscv-fesvr.git
[submodule "riscv-pk"]
path = riscv-pk
url = https://github.com/riscv/riscv-pk.git
Expand All @@ -13,9 +10,6 @@
[submodule "riscv-tests"]
path = riscv-tests
url = https://github.com/riscv/riscv-tests.git
[submodule "riscv-gnu-toolchain"]
path = riscv-gnu-toolchain
url = https://github.com/riscv/riscv-gnu-toolchain.git
[submodule "riscv-openocd"]
path = riscv-openocd
url = https://github.com/riscv/riscv-openocd.git
35 changes: 32 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ addons:
- bison
- flex
- texinfo
- help2man
- python-pexpect
- libusb-1.0-0-dev
- device-tree-compiler
Expand All @@ -30,7 +31,9 @@ env:
global:
- RISCV="/home/travis/riscv_install"
- MAKEFLAGS="-j2"
- PATH="$TRAVIS_BUILD_DIR/.build/riscv64-unknown-elf/buildtools/bin:$PATH"
- PATH="/home/travis/riscv_install/bin:$PATH"
- CROSSTOOL_VERSION=1.24.0-rc3

before_install:
# make install destination
Expand All @@ -43,14 +46,40 @@ before_install:
- cd riscv-openocd
- git submodule update --init
- cd ..
# actually use new gcc
- export CXX=g++-4.8 CC=gcc-4.8
- unset CC CXX

# extra time duing long builds
install: travis_wait

# pexpect ends up in /usr/lib/python2.7/dist-packages, which is not part of the
# default python path.
script:
- mkdir ~/src
- curl http://crosstool-ng.org/download/crosstool-ng/crosstool-ng-$CROSSTOOL_VERSION.tar.xz | tar -xJp
- cd crosstool-ng-$CROSSTOOL_VERSION; ./configure --prefix=$RISCV; cd ..
- make -C crosstool-ng-$CROSSTOOL_VERSION
- make -C crosstool-ng-$CROSSTOOL_VERSION install
- ct-ng riscv64-unknown-elf
- echo CT_CC_GCC_USE_GRAPHITE=n >> .config
- echo CT_ISL_NEEDED=n >> .config
- echo CT_ISL=n >> .config
- echo CT_MULTILIB=n >> .config
# Newlib download fails periodically, so retry the build a few times.
- travis_wait 100 ct-ng build || travis_wait 100 ct-ng build || travis_wait 100 ct-ng build
- which riscv64-unknown-elf-gcc
# Work around toolchain path issues
- cp .build/riscv64-unknown-elf/build/build-libc/riscv64-unknown-elf/libgloss/riscv/crt0.o .build/riscv64-unknown-elf/buildtools/lib/gcc/riscv64-unknown-elf/8.3.0
- cp -r .build/src/newlib-3.1.0.20181231/newlib/libc/include .build/riscv64-unknown-elf/buildtools/lib/gcc/riscv64-unknown-elf/8.3.0/../../../../riscv64-unknown-elf/include
- cp .build/riscv64-unknown-elf/build/build-libc/riscv64-unknown-elf/newlib/libm.a .build/riscv64-unknown-elf/buildtools/lib/gcc/riscv64-unknown-elf/8.3.0
- cp .build/riscv64-unknown-elf/build/build-libc/riscv64-unknown-elf/newlib/libc.a .build/riscv64-unknown-elf/buildtools/lib/gcc/riscv64-unknown-elf/8.3.0
- cp .build/riscv64-unknown-elf/build/build-libc/riscv64-unknown-elf/libgloss/riscv/libgloss.a .build/riscv64-unknown-elf/buildtools/lib/gcc/riscv64-unknown-elf/8.3.0
# Remove new autotools from path
- rm -f .build/riscv64-unknown-elf/buildtools/bin/automake*
- rm -f .build/riscv64-unknown-elf/buildtools/bin/aclocal*
# Actually build this repo
- ./build.sh
- PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages make -C riscv-tests/build debug-check
# Put compiler in expected place for debug tests
- ln -s $TRAVIS_BUILD_DIR/.build/riscv64-unknown-elf/buildtools/bin/riscv64-unknown-elf-gcc $RISCV/bin
- ln -s $TRAVIS_BUILD_DIR/.build/riscv64-unknown-elf/build/build-gdb-cross/gdb/gdb $RISCV/bin/riscv64-unknown-elf-gdb
# Run debug tests. Currently we expect 11 failures.
- PYTHONPATH=$PYTHONPATH:/usr/lib/python2.7/dist-packages make -C riscv-tests/build debug-check | grep "11 tests returned fail"
49 changes: 27 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
riscv-tools [![Build Status](https://travis-ci.org/riscv/riscv-tools.svg?branch=master)](https://travis-ci.org/riscv/riscv-tools)
===========================================================================

This repository houses a set of RISC-V simulators, compilers, and other
tools, including the following projects:
This repository houses a set of RISC-V simulators and other tools,
including the following projects:

* [Spike](https://github.com/riscv/riscv-isa-sim/), the ISA simulator
* [riscv-tests](https://github.com/riscv/riscv-tests/), a battery of
Expand All @@ -13,26 +13,31 @@ enumeration of all RISC-V opcodes executable by the simulator
a boot loader for Linux and similar OS kernels, and `pk`, a proxy kernel that
services system calls for a target-machine application by forwarding them to
the host machine
* [riscv-fesvr](https://github.com/riscv/riscv-fesvr/), the host side of
a simulation tether that services system calls on behalf of a target machine

Several RISC-V tools that were previously maintained through this repository
have since been upstreamed to their parent projects. Although this repository
continues to contain versions of the following tools, they are now primarily
supported and maintained via their parent projects:

* [Binutils](https://www.gnu.org/software/binutils/)
* [GCC](https://gcc.gnu.org/), the GNU C Compiler
* [GDB](https://www.gnu.org/software/gdb/), the GNU Debugger
* [glibc](https://www.gnu.org/software/libc/), the GNU C Library
* [QEMU](https://www.qemu.org/), an emulator
* [Newlib](https://sourceware.org/newlib/), a C library
* [OpenOCD](http://openocd.org/)

Your favorite software distribution should already have packages for
these upstream tools, but if it doesn't then the [RISC-V Port of
OpenEmbedded](https://github.com/riscv/meta-riscv#quick-start) is a
great place to start!

Several RISC-V tools that were previously maintained through this
repository have since been upstreamed to their parent projects and are
no longer included here. Your favorite software distribution should
already have packages for these upstream tools, but if it doesn't then
here are a handful of my favorites:

* Your favorite software distribution may already have packages that
include a RISC-V cross compiler, which is probably the fastest way to
get started. As of writing this README (March, 2019) I can trivially
find packages for ALT Linux, Arch Linux, Debian, Fedora, FreeBSD,
Mageia, OpenMandriva, openSUSE, and Ubuntu.
[pkgs.org](https://pkgs.org/) appears to be a good place to find an up
to date list, just search for "riscv".
* [crosstool-ng](http://crosstool-ng.github.io/docs/) can build RISC-V
cross compilers of various flavors.
* The [RISC-V Port of
OpenEmbedded](https://github.com/riscv/meta-riscv#quick-start)
builds a cross compiler, Linux kernel, and enough of userspace to do
many interesting things.
* [buildroot](https://github.com/buildroot/buildroot) is a lighter
weight cross compiled Linux distribution.

This repository uses crosstool-ng to configure a `riscv64-unknown-elf`
toolchain.

# <a name="quickstart"></a>Quickstart

Expand Down
4 changes: 1 addition & 3 deletions build-rv32ima.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

echo "Starting RISC-V Toolchain build process"

build_project riscv-fesvr --prefix=$RISCV
build_project riscv-isa-sim --prefix=$RISCV --with-fesvr=$RISCV --with-isa=rv32ima
build_project riscv-gnu-toolchain --prefix=$RISCV --with-arch=rv32ima --with-abi=ilp32
build_project riscv-isa-sim --prefix=$RISCV --with-isa=rv32ima
CC= CXX= build_project riscv-pk --prefix=$RISCV --host=riscv32-unknown-elf
build_project riscv-openocd --prefix=$RISCV --enable-remote-bitbang --disable-werror

Expand Down
3 changes: 1 addition & 2 deletions build-spike-only.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

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-isa-sim --prefix=$RISCV

echo -e "\\nRISC-V Toolchain installation completed!"
3 changes: 1 addition & 2 deletions build-spike-pk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ fi

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-isa-sim --prefix=$RISCV
CC= CXX= build_project riscv-pk --prefix=$RISCV --host=riscv64-unknown-elf

echo -e "\\nRISC-V Toolchain installation completed!"
Loading

0 comments on commit 2619062

Please sign in to comment.