Skip to content

Commit

Permalink
Build binaries for riscv64
Browse files Browse the repository at this point in the history
  • Loading branch information
kxxt committed Nov 26, 2024
1 parent 05625d7 commit bf32084
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 4 deletions.
8 changes: 4 additions & 4 deletions build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ main() {
CARGO="$(builder)"

# Test a normal debug build.
if is_arm || is_aarch64 || is_ppc64le; then
if is_arm || is_aarch64 || is_ppc64le ; then
"$CARGO" build --target "$TARGET" --release --features 'pcre2'
# pcre2 is not supported on s390x
# https://github.com/zherczeg/sljit/issues/89
elif is_s390x; then
elif is_s390x || is_riscv64; then
"$CARGO" build --release --target=$TARGET
elif is_aarch64_musl; then
# force jemalloc to allow 16K page sizes for linux musl
Expand All @@ -41,8 +41,8 @@ main() {
file target/"$TARGET"/release/rg

# Apparently tests don't work on arm, s390x and ppc64le so just bail now. I guess we provide
# ARM, ppc64le and s390x releases on a best effort basis?
if is_arm || is_aarch64 || is_arm64 || is_ppc64le || is_s390x; then
# ARM, ppc64le, riscv64 and s390x releases on a best effort basis?
if is_arm || is_aarch64 || is_arm64 || is_ppc64le || is_riscv64 || is_s390x; then
return 0
fi

Expand Down
4 changes: 4 additions & 0 deletions build/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ install_linux_dependencies() {
sudo apt-get install -y gcc-powerpc64le-linux-gnu
fi

if is_riscv64; then
sudo apt-get install -y gcc-riscv64-linux-gnu
fi

if is_s390x; then
sudo apt-get install -y gcc-s390x-linux-gnu
fi
Expand Down
8 changes: 8 additions & 0 deletions build/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ extends:
- template: build/linux.yml@self
parameters:
target: powerpc64le-unknown-linux-gnu
- job: riscv64
pool:
name: 1es-oss-ubuntu-22.04-x64
os: linux
steps:
- template: build/linux.yml@self
parameters:
target: riscv64gc-unknown-linux-gnu
- job: s390x
pool:
name: 1es-oss-ubuntu-22.04-x64
Expand Down
13 changes: 13 additions & 0 deletions build/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ architecture() {
powerpc64le-unknown-linux-gnu)
echo ppc64le
;;
riscv64gc-unknown-linux-gnu)
echo riscv64
;;
s390x-unknown-linux-gnu)
echo s390x
;;
Expand All @@ -61,6 +64,9 @@ gcc_prefix() {
ppc64le)
echo powerpc64le-linux-gnu-
;;
riscv64)
echo riscv64-linux-gnu-
;;
s390x)
echo s390x-linux-gnu-
;;
Expand Down Expand Up @@ -126,6 +132,13 @@ is_ppc64le() {
esac
}

is_riscv64() {
case "$(architecture)" in
riscv64) return 0 ;;
*) return 1 ;;
esac
}

is_s390x() {
case "$(architecture)" in
s390x) return 0 ;;
Expand Down

0 comments on commit bf32084

Please sign in to comment.