Skip to content

Commit 66a7f8b

Browse files
committed
New crosstool-ng-based toolchains
1 parent 1560e44 commit 66a7f8b

16 files changed

+904
-200
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,20 @@ Head over to the
1010
for pre-built toolchains.
1111

1212
* A GCC RV32IMC without hardfloat support, targeting [Ibex](https://github.com/lowRISC/ibex/)
13-
* A GCC multilib toolchain
13+
* A GCC elf multilib toolchain
14+
* A GCC linux multilib toolchain, with linux user-space Qemu binaries
1415

1516
How to do a release
1617
-------------------
1718

18-
1. Modify `RISCV_GNU_TOOLCHAIN_COMMIT_ID` in `azure-pipelines.yml` and
19-
other build scripts and flags as needed.
19+
1. Modify any of the following variables to configure the build:
20+
- `CROSSTOOL_NG_VERSION` in `install-crosstool-ng.sh`
21+
- `QEMU_VERSION` in `build-gcc-with-args.sh`
2022

21-
2. Push the changes or do a pull request, and wait for the pipeline to
23+
2. Modify any of the `*.config` files to update the crosstool-ng configurations
24+
for a particular toolchain.
25+
26+
3. Push the changes or do a pull request, and wait for the pipeline to
2227
complete.
2328

2429
The build can be tested by downloading the Azure Pipeline artifacts.
@@ -27,14 +32,14 @@ How to do a release
2732
3. Click on "Artifacts" (top right)
2833
4. Download the desired artifact, and test it.
2934

30-
3. Tag a release
35+
4. Tag a release
3136

3237
```bash
3338
VERSION=$(date +%Y%m%d)-1
3439
git tag -a -m "Release version $VERSION" $VERSION
3540
```
3641

37-
4. Push the tag
42+
5. Push the tag
3843

3944
```bash
4045
git push origin $VERSION

_build-deps.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# This installs the build dependencies for:
2+
# - using crosstool-ng to install a toolchain
3+
# - building qemu
4+
#
5+
steps:
6+
- bash: |
7+
sudo apt-get install -y build-essential autoconf bison flex \
8+
texinfo help2man gawk libtool-bin libncurses5-dev git libtool \
9+
gettext wget curl libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev \
10+
lld-9 clang-9 cmake
11+
displayName: 'Install build dependencies'
12+
13+
- bash: |
14+
./install-crosstool-ng.sh
15+
displayName: 'Build and install crosstool-ng'

_upload-artifacts.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
steps:
2+
- publish: $(Build.ArtifactStagingDirectory)
3+
artifact: ${{ parameters.azure_name }}
4+
displayName: "Upload Azure Artifact"
5+
6+
- task: GithubRelease@0
7+
displayName: 'Upload GitHub Release (if tagged)'
8+
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
9+
inputs:
10+
gitHubConnection: lowrisc-artifact-upload
11+
repositoryName: lowrisc/lowrisc-toolchains
12+
tagSource: manual
13+
tag: "$(ReleaseTag)"
14+
action: edit
15+
addChangeLog: false
16+
assetUploadMode: replace
17+
isPreRelease: true
18+
assets: |
19+
$(Build.ArtifactStagingDirectory)/*.tar.xz

azure-pipelines.yml

Lines changed: 66 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
# Azure Pipelines CI build configuration
22
# Documentation at https://aka.ms/yaml
33

4-
variables:
5-
# commit reference in https://github.com/riscv/riscv-gnu-toolchain
6-
RISCV_GNU_TOOLCHAIN_COMMIT_ID: 2e334e222d43bcde237c289385c977dcab81eda9
7-
84
trigger:
95
batch: true
106
branches:
@@ -19,88 +15,96 @@ pr:
1915
- '*'
2016

2117
jobs:
22-
- job: "GCC_Ibex"
23-
displayName: "RV32IMC GCC (Ibex)"
18+
- job: "Toolchains_RV32IMC"
19+
displayName: "GCC and Clang/LLVM toolchains targeting RV32IMC (Ibex)"
2420
pool:
2521
vmImage: "ubuntu-16.04"
2622
timeoutInMinutes: 360
2723
steps:
24+
- template: "_build-deps.yml"
25+
2826
- bash: |
29-
sudo apt-get install -y build-essential autoconf bison flex \
30-
texinfo help2man gawk libtool-bin libncurses5-dev git libtool \
31-
gettext wget curl
32-
displayName: 'Install build dependencies'
27+
./build-gcc-with-args.sh \
28+
"lowrisc-toolchain-gcc-rv32imc" \
29+
"riscv32-unknown-elf" \
30+
"/tools/riscv" \
31+
"-march=rv32imc" "-mabi=ilp32" "-mcmodel=medany"
32+
displayName: 'Build GCC toolchain'
33+
env:
34+
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
3335
3436
- bash: |
35-
./install-crosstool-ng.sh
36-
displayName: 'Build and install crosstool-ng'
37+
./build-clang-with-args.sh \
38+
"lowrisc-toolchain-rv32imc" \
39+
"riscv32-unknown-elf" \
40+
"/tools/riscv" \
41+
"-march=rv32imc" "-mabi=ilp32" "-mcmodel=medany"
42+
displayName: "Build Clang toolchain"
43+
env:
44+
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
45+
46+
- template: "_upload-artifacts.yml"
47+
parameters:
48+
azure_name: rv32imc-toolchains
49+
50+
- job: "GCC_Multilib_Baremetal"
51+
displayName: "RV64 GCC (Multilib Baremetal)"
52+
condition: false
53+
pool:
54+
vmImage: "ubuntu-16.04"
55+
timeoutInMinutes: 360
56+
steps:
57+
- template: "_build-deps.yml"
3758

3859
- bash: |
39-
# crosstools-NG needs the ability to create and chmod the
40-
# /tools/riscv directory.
41-
sudo mkdir -p /tools \
42-
&& sudo chmod 777 /tools \
43-
&& mkdir -p /tools/riscv \
44-
&& ./build-gcc-ibex.sh
60+
./build-gcc-with-args.sh \
61+
"lowrisc-toolchain-gcc-multilib-baremetal" \
62+
"riscv64-unknown-elf" \
63+
"/opt/riscv-baremetal-toolchain"
4564
displayName: 'Build GCC toolchain'
4665
env:
4766
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
4867
49-
- publish: $(Build.ArtifactStagingDirectory)
50-
artifact: gcc-ibex
51-
displayName: "Upload GCC for Ibex as Azure artifact"
68+
- bash: |
69+
./build-clang-with-args.sh \
70+
"lowrisc-toolchain-gcc-multilib-baremetal" \
71+
"riscv64-unknown-elf" \
72+
"/opt/riscv-baremetal-toolchain"
73+
displayName: "Build Clang toolchain"
74+
env:
75+
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
5276
53-
- task: GithubRelease@0
54-
displayName: 'Upload to GitHub releases'
55-
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
56-
inputs:
57-
gitHubConnection: lowrisc-artifact-upload
58-
repositoryName: lowrisc/lowrisc-toolchains
59-
tagSource: manual
60-
tag: "$(ReleaseTag)"
61-
action: edit
62-
addChangeLog: false
63-
assetUploadMode: replace
64-
assets: |
65-
$(Build.ArtifactStagingDirectory)/*.tar.xz
77+
- template: "_upload-artifacts.yml"
78+
parameters:
79+
azure_name: gcc-multilib-baremetal
6680

67-
- job: "GCC_Multilib"
68-
displayName: "RV64 GCC (Multilib)"
81+
- job: "GCC_Multilib_Linux"
82+
displayName: "RV64 GCC (Multilib Linux)"
6983
condition: false
7084
pool:
7185
vmImage: "ubuntu-16.04"
7286
timeoutInMinutes: 360
7387
steps:
74-
- bash: |
75-
# Dependencies as listed at
76-
# https://github.com/riscv/riscv-gnu-toolchain
77-
sudo apt-get install -y autoconf automake autotools-dev curl \
78-
libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison \
79-
flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev
80-
displayName: 'Install build dependencies'
88+
- template: "_build-deps.yml"
8189

8290
- bash: |
83-
sudo mkdir -p /tools/riscv \
84-
&& sudo chmod 777 /tools/riscv \
85-
&& ./build-gcc-multilib.sh
91+
./build-gcc-with-args.sh \
92+
"lowrisc-toolchain-gcc-multilib-linux" \
93+
"riscv64-unknown-linux-gnu" \
94+
"/opt/riscv-linux-toolchain"
8695
displayName: 'Build GCC toolchain'
8796
env:
8897
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
8998
90-
- publish: $(Build.ArtifactStagingDirectory)
91-
artifact: gcc-multilib
92-
displayName: "Upload multilib GCC builds as Azure artifact"
99+
- bash: |
100+
./build-clang-with-args.sh \
101+
"lowrisc-toolchain-gcc-multilib-linux" \
102+
"riscv64-unknown-linux-gnu" \
103+
"/opt/riscv-linux-toolchain"
104+
displayName: "Build Clang toolchain"
105+
env:
106+
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
93107
94-
- task: GithubRelease@0
95-
displayName: 'Upload to GitHub releases'
96-
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
97-
inputs:
98-
gitHubConnection: lowrisc-artifact-upload
99-
repositoryName: lowrisc/lowrisc-toolchains
100-
tagSource: manual
101-
tag: "$(ReleaseTag)"
102-
action: edit
103-
addChangeLog: false
104-
assetUploadMode: replace
105-
assets: |
106-
$(Build.ArtifactStagingDirectory)/*.tar.xz
108+
- template: "_upload-artifacts.yml"
109+
parameters:
110+
azure_name: gcc-multilib-linux

0 commit comments

Comments
 (0)