Skip to content

Commit 3ae6617

Browse files
committed
Create x64-mac and x64-win toolchains from prebuilt toolchain with multilib copied in
1 parent 7fca792 commit 3ae6617

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
bin/picotool-*-mac.zip
6868
bin/pico-sdk-tools-*-mac.zip
6969
bin/openocd-*-mac.zip
70-
bin/riscv-toolchain-*-mac.zip
70+
bin/riscv-toolchain-*.zip
7171
- name: Add Release Asset
7272
uses: softprops/action-gh-release@v2
7373
if: startsWith(github.ref, 'refs/tags/')
@@ -76,7 +76,7 @@ jobs:
7676
bin/picotool-*-mac.zip
7777
bin/pico-sdk-tools-*-mac.zip
7878
bin/openocd-*-mac.zip
79-
bin/riscv-toolchain-*-mac.zip
79+
bin/riscv-toolchain-*.zip
8080
8181
build_linux:
8282
name: Build Linux

build_macos.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,26 @@ if [[ "$SKIP_RISCV" != 1 ]]; then
107107
pushd "$builddir/riscv-install/"
108108
tar -a -cf "$topd/bin/$filename" *
109109
popd
110+
111+
# Package x64-mac riscv toolchain separately as well
112+
version="14"
113+
echo "Risc-V Toolchain version $version"
114+
115+
filename="riscv-toolchain-${version}-x64-mac.zip"
116+
117+
echo "Saving Risc-V Toolchain package to $filename"
118+
pushd "$builddir/riscv-install-x64-mac/"
119+
tar -a -cf "$topd/bin/$filename" *
120+
popd
121+
122+
# Package x64-win riscv toolchain separately as well
123+
version="14"
124+
echo "Risc-V Toolchain version $version"
125+
126+
filename="riscv-toolchain-${version}-x64-win.zip"
127+
128+
echo "Saving Risc-V Toolchain package to $filename"
129+
pushd "$builddir/riscv-install-x64-win/"
130+
tar -a -cf "$topd/bin/$filename" *
131+
popd
110132
fi
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
URL=$1
6+
SUFFIX=$2
7+
8+
BASEINSTALLDIR="riscv-install"
9+
INSTALLDIR="$BASEINSTALLDIR-$SUFFIX"
10+
rm -rf $INSTALLDIR
11+
mkdir -p $INSTALLDIR
12+
13+
BUILDDIR=$(pwd)
14+
15+
ZIPFILE=$(basename -- "$URL")
16+
FILENAME="${ZIPFILE%.*}"
17+
18+
wget $URL
19+
unzip $ZIPFILE -d $INSTALLDIR
20+
mv $INSTALLDIR/$FILENAME/* $INSTALLDIR
21+
rm -rf $INSTALLDIR/$FILENAME
22+
23+
# Remove existing multilibs
24+
rm -rf $INSTALLDIR/lib/gcc/riscv32-unknown-elf/*/rv32*
25+
rm -rf $INSTALLDIR/lib/gcc/riscv32-unknown-elf/*/rv64*
26+
rm -rf $INSTALLDIR/riscv32-unknown-elf/lib/rv32*
27+
rm -rf $INSTALLDIR/riscv32-unknown-elf/lib/rv64*
28+
29+
# Add new lib
30+
cp -r $BASEINSTALLDIR/lib/gcc/riscv32-unknown-elf/*/rv32* $INSTALLDIR/lib/gcc/riscv32-unknown-elf/*/
31+
cp -r $BASEINSTALLDIR/riscv32-unknown-elf/lib/rv32* $INSTALLDIR/riscv32-unknown-elf/lib/

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,10 @@ cd riscv-gnu-toolchain
1616
./configure --prefix=$BUILDDIR/$INSTALLDIR --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--" --with-gcc-src=$BUILDDIR/gcc
1717
# 4 threads, as 8 threads runs out of memory
1818
make -j4
19+
20+
# Make x64 and Windows toolchains, by copying multilib into existing toolchains
21+
cd ..
22+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
23+
24+
$SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-macos-release/21/artifact/riscv32-embecosm-macos-gcc13.3.0.zip" "x64-mac"
25+
$SCRIPT_DIR/build-riscv-gcc-other.sh "https://buildbot.embecosm.com/job/riscv32-gcc-win64-release/24/artifact/riscv32-embecosm-win64-gcc13.2.0.zip" "x64-win"

0 commit comments

Comments
 (0)