Skip to content

Commit 00821b2

Browse files
committed
Attempt build of x64 on arm64 runner
1 parent fbc5f0d commit 00821b2

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,37 @@ jobs:
121121
files: |
122122
bin/openocd-*-mac.zip
123123
bin/riscv-toolchain-*.zip
124+
125+
build_macos_x64_on_arm64:
126+
name: Build MacOS x64 on arm64
127+
runs-on: 'macos-14'
128+
env:
129+
# Universal picotool is built on arm64
130+
SKIP_PICOTOOL: 1
131+
132+
steps:
133+
- name: Checkout
134+
uses: actions/checkout@v4
135+
- name: Set up x86_64 Homebrew
136+
if: runner.environment == 'github-hosted'
137+
run: |
138+
NONINTERACTIVE=1 arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
139+
- name: Build
140+
run: arch -x86_64 ./build_macos.sh
141+
- name: Upload Artifact
142+
uses: actions/upload-artifact@v4
143+
with:
144+
name: tools-mac-x64-on-arm64
145+
path: |
146+
bin/openocd-*-mac.zip
147+
bin/riscv-toolchain-*.zip
148+
- name: Add Release Asset
149+
uses: softprops/action-gh-release@v2
150+
if: startsWith(github.ref, 'refs/tags/')
151+
with:
152+
files: |
153+
bin/openocd-*-mac.zip
154+
bin/riscv-toolchain-*.zip
124155
125156
build_linux:
126157
name: Build Linux

packages/macos/riscv/build-riscv-gcc.sh

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ mkdir -p $INSTALLDIR
88

99
BUILDDIR=$(pwd)
1010

11-
GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew"
12-
export GDB_TARGET_FLAGS_EXTRA
11+
if [[ $(uname -m) == 'arm64' ]]; then
12+
GDB_TARGET_FLAGS_EXTRA="--with-gmp=/opt/homebrew --with-mpfr=/opt/homebrew"
13+
export GDB_TARGET_FLAGS_EXTRA
14+
fi
1315

1416
cd riscv-gnu-toolchain
1517
./configure --prefix=$BUILDDIR/$INSTALLDIR --enable-strip --with-arch=rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb --with-abi=ilp32 --with-multilib-generator="rv32ima_zicsr_zifencei_zba_zbb_zbs_zbkb_zca_zcb-ilp32--;rv32imac_zicsr_zifencei_zba_zbb_zbs_zbkb-ilp32--"

0 commit comments

Comments
 (0)