Skip to content

Commit aca83f9

Browse files
ziuziakowskaluismarques
authored andcommitted
Update README, Add Bazel integration instructions
Signed-off-by: Alice Ziuziakowska <[email protected]>
1 parent bbbbad5 commit aca83f9

File tree

1 file changed

+68
-24
lines changed

1 file changed

+68
-24
lines changed

README.md

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,94 @@
1-
lowRISC toolchain builds
1+
lowRISC Toolchain Builds
22
========================
33

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.
76

87
Head over to the
98
[GitHub releases for this repository](https://github.com/lowRISC/lowrisc-toolchains/releases)
109
for pre-built toolchains.
1110

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:
1412

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+
------------------
1718

1819
1. Push the changes or do a pull request, and wait for the CI workflow to
1920
complete.
2021

2122
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).
2324
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.
2526

26-
2. Tag a release
27+
2. Tag the release.
2728

28-
```bash
29+
```sh
2930
VERSION=$(date +%Y%m%d)-1
3031
git tag -a -m "Release version $VERSION" $VERSION
3132
```
3233

33-
3. Push the tag
34+
3. Push the tag.
3435

35-
```bash
36+
```sh
3637
git push origin $VERSION
3738
```
3839

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
4141
[GitHub releases](https://github.com/lowRISC/lowrisc-toolchains/releases).
4242

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

Comments
 (0)