File tree Expand file tree Collapse file tree 3 files changed +27
-19
lines changed Expand file tree Collapse file tree 3 files changed +27
-19
lines changed Original file line number Diff line number Diff line change 1- # Expect host is Linux/x86_64
1+ # Expect host is Linux/x86_64, Linux/aarch64, macOS/arm64
2+
3+ MACHINE_TYPE=$( uname -m)
4+ OS_TYPE=$( uname -s)
5+
26check_platform ()
37{
4- MACHINE_TYPE=` uname -m`
5- OS_TYPE=` uname -s`
6-
78 case " ${MACHINE_TYPE} /${OS_TYPE} " in
8- x86_64/Linux | aarch64/Linux)
9- ;;
10- Arm64/Darwin)
11- echo " Apple Silicon is not supported yet"
12- exit 1
9+ x86_64/Linux | aarch64/Linux | arm64/Darwin)
1310 ;;
1411 * )
1512 echo " Unsupported platform: ${MACHINE_TYPE} /${OS_TYPE} "
1613 exit 1
1714 ;;
1815 esac
19-
2016}
17+
18+ if [[ " ${OS_TYPE} " == " Linux" ]]; then
19+ PARALLEL=-j$( nproc)
20+ else
21+ PARALLEL=-j$( sysctl -n hw.logicalcpu)
22+ fi
Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
22
3+ . .ci/common.sh
4+
35set -e -u -o pipefail
46
57# Install RISCOF
68pip3 install -r requirements.txt
79
810set -x
911
10- export PATH=` pwd` /toolchain/bin:$PATH
11-
12- PARALLEL=-j$( nproc)
12+ export PATH=$( pwd) /toolchain/bin:$PATH
1313
1414make distclean
1515# Rebuild with all RISC-V extensions
Original file line number Diff line number Diff line change @@ -5,20 +5,26 @@ set -e -u -o pipefail
55. .ci/common.sh
66
77check_platform
8-
98mkdir -p toolchain
109
1110if [[ " $# " == " 0" ]] || [[ " $1 " != " riscv-collab" ]]; then
1211 GCC_VER=14.2.0-3
1312 TOOLCHAIN_REPO=https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack
1413
15- if [[ ${MACHINE_TYPE} == " x86_64" ]]; then
16- TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -linux-x64.tar.gz
17- elif [[ ${MACHINE_TYPE} == " aarch64" ]]; then
18- TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -linux-arm64.tar.gz
14+ if [[ " ${OS_TYPE} " == " Linux" ]]; then
15+ case " ${MACHINE_TYPE} " in
16+ " x86_64" )
17+ TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -linux-x64.tar.gz
18+ ;;
19+ " aarch64" )
20+ TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -linux-arm64.tar.gz
21+ ;;
22+ esac
23+ else # Darwin
24+ TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -darwin-arm64.tar.gz
1925 fi
2026else
21- UBUNTU_VER=` lsb_release -r | cut -f2`
27+ UBUNTU_VER=$( lsb_release -r | cut -f2)
2228 GCC_VER=2025.01.20
2329 TOOLCHAIN_REPO=https://github.com/riscv-collab/riscv-gnu-toolchain
2430 TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/${GCC_VER} /riscv32-elf-ubuntu-${UBUNTU_VER} -gcc-nightly-${GCC_VER} -nightly.tar.xz
You can’t perform that action at this time.
0 commit comments