File tree Expand file tree Collapse file tree 3 files changed +23
-17
lines changed Expand file tree Collapse file tree 3 files changed +23
-17
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} "
@@ -18,3 +15,9 @@ check_platform()
1815 esac
1916
2017}
18+
19+ if [[ " ${OS_TYPE} " == " Linux" ]]; then
20+ PARALLEL=-j$( nproc)
21+ else
22+ PARALLEL=-j$( sysctl -n hw.logicalcpu)
23+ 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 git+https://github.com/riscv/riscof.git@d38859f85fe407bcacddd2efcd355ada4683aee4
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,17 +5,20 @@ 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+ 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
19+ fi
20+ else
21+ TOOLCHAIN_URL=${TOOLCHAIN_REPO} /releases/download/v${GCC_VER} /xpack-riscv-none-elf-gcc-${GCC_VER} -darwin-arm64.tar.gz
1922 fi
2023else
2124 UBUNTU_VER=` lsb_release -r | cut -f2`
You can’t perform that action at this time.
0 commit comments