Skip to content

Commit

Permalink
Add Risc-V build on x86 Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
will-v-pi committed Aug 28, 2024
1 parent aad89a0 commit d847edd
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Build
run: SKIP_RISCV=1 ./build_linux.sh
run: SKIP_RISCV=0 ./build_linux.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
14 changes: 3 additions & 11 deletions build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,15 @@ do
filename=${filename%"-rp2350"}
repodir="$builddir/${filename}"

pi_only=$(echo "$repo" | jq -r .pi_only)
if [[ "$pi_only" == "true" ]]; then
if [[ $(uname -m) != 'aarch64' ]]; then
echo "Skipping Pi only $repodir"
continue
fi
fi

echo "${href} ${tree} ${filename} ${extension} ${repodir}"
rm -rf "${repodir}"
git clone -b "${tree}" --depth=1 -c advice.detachedHead=false "${href}" "${repodir}"
done < <(echo "$repos")


cd $builddir
if [[ "$SKIP_RISCV" != 1 ]] && [[ $(uname -m) == 'aarch64' ]]; then
# Only need this for pi, and it takes ages to build
if [[ "$SKIP_RISCV" != 1 ]]; then
# Takes ages to build
../packages/linux/riscv/build-riscv-gcc.sh
fi
../packages/linux/openocd/build-openocd.sh
Expand Down Expand Up @@ -88,7 +80,7 @@ pushd "$builddir/openocd-install/usr/local/bin"
tar -a -cf "$topd/bin/$filename" * -C "../share/openocd" "scripts"
popd

if [[ "$SKIP_RISCV" != 1 ]] && [[ $(uname -m) == 'aarch64' ]]; then
if [[ "$SKIP_RISCV" != 1 ]]; then
# Package riscv toolchain separately as well
version="14"
echo "Risc-V Toolchain version $version"
Expand Down
6 changes: 2 additions & 4 deletions config/repositories.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@
},
{
"href": "https://github.com/riscv/riscv-gnu-toolchain.git",
"tree": "master",
"pi_only": true
"tree": "master"
},
{
"href": "https://github.com/gcc-mirror/gcc",
"tree": "releases/gcc-14",
"pi_only": true
"tree": "releases/gcc-14"
}
]
}

0 comments on commit d847edd

Please sign in to comment.