]> Cypherpunks repositories - gostls13.git/commitdiff
misc/nacl: add go_nacl_arm_exec, update README
authorShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 19:15:32 +0000 (15:15 -0400)
committerShenghou Ma <minux@golang.org>
Thu, 10 Jul 2014 19:15:32 +0000 (15:15 -0400)
LGTM=dave, rsc
R=rsc, iant, dave
CC=golang-codereviews
https://golang.org/cl/109390043

misc/nacl/README
misc/nacl/go_nacl_arm_exec [new file with mode: 0755]

index 9cc2bda604230a5d7dbc701baae8ffb703cad618..710587dfce0149803d54ee865dd4ce08a882168e 100644 (file)
@@ -3,10 +3,11 @@ Native Client
 
 This document outlines the basics of building and developing the Go runtime and programs in the Native Client (NaCl) environment.
 
-Go 1.3 supports two architectures
+Go 1.3 supports three architectures
 
  * nacl/386 which is standard 386.
  * nacl/amd64p32 which is a 64 bit architecture, where the address space is limited to a 4gb window. 
+ * nacl/arm which is 32-bit ARMv7A architecture with 1GB address space.
 
 For background it is recommended that you read http://golang.org/s/go13nacl.
 
@@ -28,12 +29,14 @@ The zip file contains a small skeleton that can be used to download the correct
        % cd /opt/nacl_sdk
        % ./naclsdk update
 
-At this time pepper_33 is the stable version. If naclsdk downloads a later version, please adjust accordingly.
+At this time pepper_33 is the stable version. If naclsdk downloads a later version, please adjust accordingly. As of June 2014, only the canary sdk provides support for nacl/arm.
 
-The cmd/go helper scripts expect that the runtime loaders, sel_ldr_x86_{32,64} are in your path. I find it easiest to make a symlink from the NaCl distribution to my $GOPATH/bin directory.
+The cmd/go helper scripts expect that the runtime loaders, sel_ldr_{x86_{32,64},arm} and nacl_helper_bootstrap_arm are in your path. I find it easiest to make a symlink from the NaCl distribution to my $GOPATH/bin directory.
 
        % ln -nfs /opt/nacl_sdk/pepper_33/tools/sel_ldr_x86_32 $GOPATH/bin/sel_ldr_x86_32
        % ln -nfs /opt/nacl_sdk/pepper_33/tools/sel_ldr_x86_64 $GOPATH/bin/sel_ldr_x86_64
+       % ln -nfs /opt/nacl_sdk/pepper_canary/tools/sel_ldr_arm $GOPATH/bin/sel_ldr_arm
+       % ln -nfs /opt/nacl_sdk/pepper_canary/tools/nacl_helper_bootstrap_arm $GOPATH/bin/nacl_helper_bootstrap_arm # only required for NaCl/ARM.
 
 Support scripts
 ---------------
@@ -42,6 +45,7 @@ Symlink the two scripts in this directory into your $PATH, just as you did with
 
        % ln -nfs $GOROOT/go/misc/nacl/go_nacl_amd64p32_exec $GOPATH/bin/go_nacl_amd64p32_exec
        % ln -nfs $GOROOT/go/misc/nacl/go_nacl_386_exec $GOPATH/bin/go_nacl_386_exec
+       % ln -nfs $GOROOT/go/misc/nacl/go_nacl_arm_exec $GOPATH/bin/go_nacl_arm_exec
 
 Building and testing
 --------------------
diff --git a/misc/nacl/go_nacl_arm_exec b/misc/nacl/go_nacl_arm_exec
new file mode 100755 (executable)
index 0000000..4275cb1
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+eval $(go env)
+
+export NACLENV_GOARCH=$GOARCH
+export NACLENV_GOOS=$GOOS
+export NACLENV_GOROOT=/go
+export NACLENV_NACLPWD=$(pwd | sed "s;$GOROOT;/go;")
+
+exec nacl_helper_bootstrap_arm $(which sel_ldr_arm) --reserved_at_zero=0xXXXXXXXXXXXXXXXX -l /dev/null -S -e "$@"