Skip to content

Commit

Permalink
Also build for Android RISCV64.
Browse files Browse the repository at this point in the history
  • Loading branch information
rmacnak committed Oct 19, 2024
1 parent 9e4512b commit 8924f1f
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
with:
arch: x86_64
api-level: 28
script: ./.github/workflows/test-android-x64
script: ./test-android
web:
runs-on: ubuntu-latest
timeout-minutes: 10
Expand Down
5 changes: 5 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -432,4 +432,9 @@ def Main():
BuildVM(target_cxx, 'x64', 'android', False, None)
BuildVM(target_cxx, 'x64', 'android', True, None)

target_cxx = ndk + '/toolchains/llvm/prebuilt/' \
+ android_host_name + '/bin/riscv64-linux-android35-clang++'
BuildVM(target_cxx, 'riscv64', 'android', False, None)
BuildVM(target_cxx, 'riscv64', 'android', True, None)

Main()
98 changes: 6 additions & 92 deletions test
Original file line number Diff line number Diff line change
@@ -1,95 +1,9 @@
#!/bin/sh -e
#!/bin/sh -ex

test_x64() {
set -x
out/DebugX64/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseX64/primordialsoup out/snapshots/HelloApp.vfuel
out/DebugHost/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseHost/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugX64/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseX64/primordialsoup out/snapshots/TestRunner.vfuel
out/DebugHost/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseHost/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseX64/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_x64_and_ia32() {
set -x
out/DebugIA32/primordialsoup out/snapshots/HelloApp.vfuel
out/DebugX64/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseIA32/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseX64/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugIA32/primordialsoup out/snapshots/TestRunner.vfuel
out/DebugX64/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseIA32/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseX64/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseIA32/primordialsoup out/snapshots/BenchmarkRunner.vfuel
out/ReleaseX64/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_arm64() {
set -x
out/DebugARM64/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseARM64/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugARM64/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseARM64/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseARM64/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_arm() {
set -x
out/DebugARM/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseARM/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugARM/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseARM/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseARM/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_mips() {
set -x
out/DebugMIPS/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseMIPS/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugMIPS/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseMIPS/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseMIPS/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_riscv64() {
set -x
out/DebugRISCV64/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseRISCV64/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugRISCV64/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseRISCV64/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseRISCV64/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

test_riscv32() {
set -x
out/DebugRISCV32/primordialsoup out/snapshots/HelloApp.vfuel
out/ReleaseRISCV32/primordialsoup out/snapshots/HelloApp.vfuel

out/DebugRISCV32/primordialsoup out/snapshots/TestRunner.vfuel
out/ReleaseRISCV32/primordialsoup out/snapshots/TestRunner.vfuel

out/ReleaseRISCV32/primordialsoup out/snapshots/BenchmarkRunner.vfuel
}

case $(uname -m) in
x86_64) test_x64 ;;
aarch64) test_arm64 ;;
arm64) test_arm64 ;;
armv7l) test_arm ;;
armv6l) test_arm ;;
mips) test_mips ;;
riscv64) test_riscv64 ;;
riscv32) test_riscv32 ;;
*) echo Unknown architecture $(uname -m)
esac
out/ReleaseHost/primordialsoup out/snapshots/BenchmarkRunner.vfuel
24 changes: 24 additions & 0 deletions test-android
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash -ex

case $(adb shell uname -m) in
i386) ARCH=IA32 ;;
i686) ARCH=IA32 ;;
x86_64) ARCH=X64 ;;
armv7l) ARCH=ARM ;;
aarch64) ARCH=ARM64 ;;
riscv64) ARCH=RISCV64 ;;
esac

adb push out/snapshots/HelloApp.vfuel /data/local/tmp
adb push out/snapshots/TestRunner.vfuel /data/local/tmp
adb push out/snapshots/IOTestRunner.vfuel /data/local/tmp
adb push out/snapshots/BenchmarkRunner.vfuel /data/local/tmp

adb push out/DebugAndroid$ARCH/primordialsoup /data/local/tmp
adb shell /data/local/tmp/primordialsoup /data/local/tmp/HelloApp.vfuel
adb shell /data/local/tmp/primordialsoup /data/local/tmp/TestRunner.vfuel

adb push out/ReleaseAndroid$ARCH/primordialsoup /data/local/tmp
adb shell /data/local/tmp/primordialsoup /data/local/tmp/HelloApp.vfuel
adb shell /data/local/tmp/primordialsoup /data/local/tmp/TestRunner.vfuel
adb shell /data/local/tmp/primordialsoup /data/local/tmp/BenchmarkRunner.vfuel

0 comments on commit 8924f1f

Please sign in to comment.