summaryrefslogtreecommitdiff
path: root/src/nacltest.bash
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2014-07-10 15:15:41 -0400
committerShenghou Ma <minux@golang.org>2014-07-10 15:15:41 -0400
commit5b77819bc9c9de5b51cdca2c95b3b443ce7e1adf (patch)
tree4d990725fd9c6bddd0c57b3eb40a4acc87baae5e /src/nacltest.bash
parenta4ddee05dbe79e369e561d64f65e71d40ca55882 (diff)
downloadgo-5b77819bc9c9de5b51cdca2c95b3b443ce7e1adf.tar.gz
nacltest.bash: nacl/arm support.
Also detect GOARCH automatically based on `uname -m`. LGTM=crawshaw, dave, rsc R=rsc, iant, crawshaw, dave CC=golang-codereviews https://codereview.appspot.com/111780043
Diffstat (limited to 'src/nacltest.bash')
-rwxr-xr-xsrc/nacltest.bash23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/nacltest.bash b/src/nacltest.bash
index 33fc8c1c4..2b62830a8 100755
--- a/src/nacltest.bash
+++ b/src/nacltest.bash
@@ -13,8 +13,23 @@
set -e
ulimit -c 0
+# guess GOARCH if not set
+naclGOARCH=$GOARCH
+if [ -z "$naclGOARCH" ]; then
+ case "$(uname -m)" in
+ x86_64)
+ naclGOARCH=amd64p32
+ ;;
+ armv7l) # NativeClient on ARM only supports ARMv7A.
+ naclGOARCH=arm
+ ;;
+ i?86)
+ naclGOARCH=386
+ ;;
+ esac
+fi
+
# Check GOARCH.
-naclGOARCH=${GOARCH:-386}
case "$naclGOARCH" in
amd64p32)
if ! which sel_ldr_x86_64 >/dev/null; then
@@ -28,6 +43,12 @@ amd64p32)
exit 1
fi
;;
+arm)
+ if ! which sel_ldr_arm >/dev/null; then
+ echo 'cannot find sel_ldr_arm' 1>&2
+ exit 1
+ fi
+ ;;
*)
echo 'unsupported $GOARCH for nacl: '"$naclGOARCH" 1>&2
exit 1