Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build binaries for riscv64 #41

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading