diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..3dca137 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,42 @@ +# Azure Pipelines CI build configuration +# Documentation at https://aka.ms/yaml + +variables: + # commit reference in https://github.com/riscv/riscv-gnu-toolchain + RISCV_GNU_TOOLCHAIN_COMMIT_ID: 2e334e222d43bcde237c289385c977dcab81eda9 + +trigger: + branches: + include: + - master + +jobs: +- job: "GCC" + displayName: "RV32 GCC" + pool: + vmImage: "ubuntu-16.04" + steps: + - bash: | + # Dependencies as listed at + # https://github.com/riscv/riscv-gnu-toolchain + sudo apt-get install -y autoconf automake autotools-dev curl \ + libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison \ + flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev + displayName: 'Install build dependencies' + + - bash: | + sudo mkdir /tools/riscv && sudo chmod 777 /tools/riscv + ./build-gcc.sh + displayName: 'Build GCC toolchain' + env: + ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory) + + - task: GithubRelease@0 + displayName: 'Upload to GitHub releases' + inputs: + gitHubConnection: lowrisc-artifact-upload + repositoryName: lowrisc/lowrisc-toolchains + tagSource: auto + assets: | + $(Build.ArtifactStagingDirectory)/build.log + $(Build.ArtifactStagingDirectory)/*.tar.xz diff --git a/build-gcc.sh b/build-gcc.sh new file mode 100755 index 0000000..b8013c3 --- /dev/null +++ b/build-gcc.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +set -e +set -x + +TOP=$PWD + +TOOLCHAIN_NAME=lowrisc-toolchain-gcc-rv32imc-$(git -C $TOP describe --always) + +mkdir -p build/gcc +cd build/gcc +git clone --recursive https://github.com/riscv/riscv-gnu-toolchain +cd riscv-gnu-toolchain +git checkout $RISCV_GNU_TOOLCHAIN_COMMIT_ID +./configure --prefix=/tools/riscv \ + --with-abi=ilp32 \ + --with-arch=rv32imc \ + --with-cmodel=medany 2>&1 | tee $ARTIFACT_STAGING_DIR/build.log +make -j$(nproc) 2>&1 | tee $ARTIFACT_STAGING_DIR/build.log +# Includes make install + +echo 'Version:' >> /tools/riscv/buildinfo +git -C $TOP describe --always >> /tools/riscv/buildinfo +echo >> /tools/riscv/buildinfo + +echo 'Version of https://github.com/riscv/riscv-gnu-toolchain:' >> /tools/riscv/buildinfo +git -C $TOP/build/gcc/riscv-gnu-toolchain describe --always >> /tools/riscv/buildinfo +echo >> /tools/riscv/buildinfo + +echo 'GCC version:' >> /tools/riscv/buildinfo +/tools/riscv/bin/riscv32-unknown-elf-gcc --version | head -n1 >> /tools/riscv/buildinfo +echo >> /tools/riscv/buildinfo + +echo "Built at $(date -u) on $(hostname)" >> /tools/riscv/buildinfo +echo >> /tools/riscv/buildinfo + +tar -cJ \ + --directory=/tools \ + -f $ARTIFACT_STAGING_DIR/$TOOLCHAIN_NAME.tar.xz \ + --transform="s@riscv@$TOOLCHAIN_NAME@" \ + --owner=0 --group=0 \ + riscv