|
1 | | -lowRISC toolchain builds |
| 1 | +lowRISC Toolchain Builds |
2 | 2 | ======================== |
3 | 3 |
|
4 | | -This repository contains tools to create toolchains for lowRISC internal |
5 | | -use. The toolchains are *not supported* by lowRISC or recommended to be |
6 | | -used outside of lowRISC. |
| 4 | +This repository contains toolchain builds and tools to create toolchains for lowRISC internal and partner use. |
| 5 | +The toolchains are *not supported* by lowRISC or recommended to be used outside of lowRISC and partners. |
7 | 6 |
|
8 | 7 | Head over to the |
9 | 8 | [GitHub releases for this repository](https://github.com/lowRISC/lowrisc-toolchains/releases) |
10 | 9 | for pre-built toolchains. |
11 | 10 |
|
12 | | -* Clang RV32IMCB without hardfloat support, targeting [Ibex](https://github.com/lowRISC/ibex/) |
13 | | -* Clang RV64IMAC, targeting [Muntjac](https://github.com/lowRISC/muntjac) |
| 11 | +The following toolchains are provided: |
14 | 12 |
|
15 | | -How to do a release |
16 | | -------------------- |
| 13 | +* Binutils + Clang RV32IMCB without hardfloat support, targeting [Ibex](https://github.com/lowRISC/ibex). |
| 14 | +* Binutils + Clang RV64IMAC, targeting [Muntjac](https://github.com/lowRISC/muntjac). |
| 15 | + |
| 16 | +Creating a Release |
| 17 | +------------------ |
17 | 18 |
|
18 | 19 | 1. Push the changes or do a pull request, and wait for the CI workflow to |
19 | 20 | complete. |
20 | 21 |
|
21 | 22 | The build can be tested by downloading the GitHub artifacts. |
22 | | - 1. Go to the [lowrisc-toolchains Actions page](https://github.com/lowRISC/lowrisc-toolchains/actions). |
| 23 | + 1. Go to the [Github Actions page](https://github.com/lowRISC/lowrisc-toolchains/actions). |
23 | 24 | 2. Select a workflow run from the list. |
24 | | - 4. Download the desired artifact from the bottom of the page and test it. |
| 25 | + 3. Download the desired artifact from the bottom of the page and test it. |
25 | 26 |
|
26 | | -2. Tag a release |
| 27 | +2. Tag the release. |
27 | 28 |
|
28 | | - ```bash |
| 29 | + ```sh |
29 | 30 | VERSION=$(date +%Y%m%d)-1 |
30 | 31 | git tag -a -m "Release version $VERSION" $VERSION |
31 | 32 | ``` |
32 | 33 |
|
33 | | -3. Push the tag |
| 34 | +3. Push the tag. |
34 | 35 |
|
35 | | - ```bash |
| 36 | + ```sh |
36 | 37 | git push origin $VERSION |
37 | 38 | ``` |
38 | 39 |
|
39 | | - Now the release builds on GitHub's CI, and the resulting binaries |
40 | | - will be uploaded to |
| 40 | + Now the release builds on GitHub's CI, and the resulting binaries will be uploaded to |
41 | 41 | [GitHub releases](https://github.com/lowRISC/lowrisc-toolchains/releases). |
42 | 42 |
|
43 | | -How to install pre-built toolchain |
44 | | ------------------------------------- |
45 | | -1. Download a tar.gz file from release page. |
46 | | -2. Decompress files to ~/.local |
47 | | -``` |
48 | | - tar -xf <location of your tar.gz> --strip-components=1 -C ~/.local |
49 | | -``` |
50 | | -3. Now you should be able to compile software with lowrisc-toolchain. |
| 43 | + |
| 44 | +Manual Installation |
| 45 | +------------------- |
| 46 | + |
| 47 | +1. Download a release archive matching your host architecture and target system from the |
| 48 | + [Github releases](https://github.com/lowRISC/lowrisc-toolchains/releases). |
| 49 | + |
| 50 | +2. Extract the archive: |
| 51 | + |
| 52 | + ```sh |
| 53 | + xzcat <path to the downloaded archive> | tar -xvf - |
| 54 | + ``` |
| 55 | + |
| 56 | +3. You should now be able to use the toolchain. You may optionally add the `bin` subfolder |
| 57 | + to your `PATH` to use the binaries from anywhere. |
| 58 | + |
| 59 | +Opentitan Bazel Integration |
| 60 | +--------------------------- |
| 61 | + |
| 62 | +The Ibex toolchain artifacts are consumed by Bazel for building Opentitan software. |
| 63 | +For development and testing purposes, you may override the toolchain used with a local build |
| 64 | +instead of a released version. |
| 65 | + |
| 66 | +In the following steps, `OPENTITAN` denotes the path to your Opentitan checkout, and |
| 67 | +`TOOLCHAIN` denotes the path to the toolchain you wish to override with |
| 68 | +(if you have a locally built toolchain, this should be the `dist` folder). |
| 69 | + |
| 70 | +1. Create an empty `REPO.bazel` file in the toolchain folder. |
| 71 | + |
| 72 | + ```sh |
| 73 | + touch $TOOLCHAIN/REPO.bazel |
| 74 | + ``` |
| 75 | + |
| 76 | +2. Create a symbolic link called `BUILD` in the toolchain folder, pointing to the toolchain's |
| 77 | + build file in the Opentitan checkout. |
| 78 | + |
| 79 | + ```sh |
| 80 | + ln -s $OPENTITAN/third_party/lowrisc/BUILD.lowrisc_rv32imcb_toolchain.bazel $TOOLCHAIN/BUILD |
| 81 | + ``` |
| 82 | + |
| 83 | +3. Override the repository in your Bazel commands. |
| 84 | + |
| 85 | + ```sh |
| 86 | + bazel --override_repository=+lowrisc_rv32imcb_toolchain+lowrisc_rv32imcb_toolchain=$TOOLCHAIN ... |
| 87 | + ``` |
| 88 | + |
| 89 | + Repeatedly specifying the flag can be tedious, so to override the repository by default for all |
| 90 | + commands, create a `.bazelrc-site` file in your Opentitan checkout containing the following: |
| 91 | + |
| 92 | + ``` |
| 93 | + common --override_repository=+lowrisc_rv32imcb_toolchain+lowrisc_rv32imcb_toolchain=<path to your toolchain> |
| 94 | + ``` |
0 commit comments