diff --git a/build/build.sh b/build/build.sh index 12f1be1..c7031e7 100755 --- a/build/build.sh +++ b/build/build.sh @@ -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 @@ -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 diff --git a/build/install.sh b/build/install.sh index 62e2c3e..8a008f2 100755 --- a/build/install.sh +++ b/build/install.sh @@ -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 diff --git a/build/main.yml b/build/main.yml index a1892d0..060aed0 100644 --- a/build/main.yml +++ b/build/main.yml @@ -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 diff --git a/build/utils.sh b/build/utils.sh index 56fb9f2..bf4bad3 100755 --- a/build/utils.sh +++ b/build/utils.sh @@ -41,6 +41,9 @@ architecture() { powerpc64le-unknown-linux-gnu) echo ppc64le ;; + riscv64gc-unknown-linux-gnu) + echo riscv64 + ;; s390x-unknown-linux-gnu) echo s390x ;; @@ -61,6 +64,9 @@ gcc_prefix() { ppc64le) echo powerpc64le-linux-gnu- ;; + riscv64) + echo riscv64-linux-gnu- + ;; s390x) echo s390x-linux-gnu- ;; @@ -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 ;;