|
1 | 1 | # The Go Programming Language
|
2 | 2 |
|
3 |
| -Go is an open source programming language that makes it easy to build simple, |
4 |
| -reliable, and efficient software. |
| 3 | +## RISC-V Go Port |
5 | 4 |
|
6 |
| - |
| 5 | +This repository is home of the RISC-V port of the Go programming language. |
7 | 6 |
|
8 |
| -For documentation about how to install and use Go, |
9 |
| -visit https://golang.org/ or load doc/install-source.html |
10 |
| -in your web browser. |
| 7 | +The upstream Go project can be found at https://github.com/golang/go. |
11 | 8 |
|
12 |
| -Our canonical Git repository is located at https://go.googlesource.com/go. |
13 |
| -There is a mirror of the repository at https://github.com/golang/go. |
| 9 | +### Quick Start |
14 | 10 |
|
15 |
| -Go is the work of hundreds of contributors. We appreciate your help! |
| 11 | +Setup: |
16 | 12 |
|
17 |
| -To contribute, please read the contribution guidelines: |
18 |
| - https://golang.org/doc/contribute.html |
| 13 | +```sh |
| 14 | +$ git clone https://review.gerrithub.io/riscv/riscv-go riscv-go |
| 15 | +$ cd riscv-go |
| 16 | +$ git checkout riscvdev # RISC-V work happens on this branch |
| 17 | +$ export GOROOT_BOOTSTRAP=/path/to/prebuilt/go/tree |
| 18 | +$ export PATH="$(pwd)/misc/riscv:$(pwd)/bin:$PATH" |
| 19 | +$ cd src |
| 20 | +$ ./make.bash |
| 21 | +``` |
19 | 22 |
|
20 |
| -##### Note that we do not accept pull requests and that we use the issue tracker for bug reports and proposals only. Please ask questions on https://forum.golangbridge.org or https://groups.google.com/forum/#!forum/golang-nuts. |
| 23 | +Compile and run in spike using pk (which are expected to be in PATH): |
21 | 24 |
|
22 |
| -Unless otherwise noted, the Go source files are distributed |
23 |
| -under the BSD-style license found in the LICENSE file. |
| 25 | +```sh |
| 26 | +$ GOARCH=riscv GOOS=linux go run ../riscvtest/add.go |
| 27 | +``` |
24 | 28 |
|
25 |
| --- |
| 29 | +Build: |
26 | 30 |
|
27 |
| -## Binary Distribution Notes |
| 31 | +```sh |
| 32 | +$ GOARCH=riscv GOOS=linux go build ../riscvtest/add.go |
| 33 | +``` |
28 | 34 |
|
29 |
| -If you have just untarred a binary Go distribution, you need to set |
30 |
| -the environment variable $GOROOT to the full path of the go |
31 |
| -directory (the one containing this file). You can omit the |
32 |
| -variable if you unpack it into /usr/local/go, or if you rebuild |
33 |
| -from sources by running all.bash (see doc/install-source.html). |
34 |
| -You should also add the Go binary directory $GOROOT/bin |
35 |
| -to your shell's path. |
| 35 | +Test: |
36 | 36 |
|
37 |
| -For example, if you extracted the tar file into $HOME/go, you might |
38 |
| -put the following in your .profile: |
| 37 | +Our basic tests are in the `riscvtest` directory: |
39 | 38 |
|
40 |
| - export GOROOT=$HOME/go |
41 |
| - export PATH=$PATH:$GOROOT/bin |
| 39 | +```sh |
| 40 | +$ cd ../riscvtest |
| 41 | +$ go run run.go |
| 42 | +``` |
42 | 43 |
|
43 |
| -See https://golang.org/doc/install or doc/install.html for more details. |
| 44 | +If this exits without error, all is well! |
| 45 | + |
| 46 | +Note that these tests currently use the special builtin `riscvexit` to exit, |
| 47 | +until we can build the standard library and use os.Exit. |
| 48 | + |
| 49 | +### Contributing |
| 50 | + |
| 51 | +All contributors must sign the upstream [Contributor License |
| 52 | +Agreement](https://golang.org/doc/contribute.html#cla), as this port will be |
| 53 | +merged into upstream Go upon completion. |
| 54 | + |
| 55 | +Code review occurs via our |
| 56 | +[GerritHub](https://review.gerrithub.io/#/admin/projects/riscv/riscv-go) |
| 57 | +project, rather than via GitHub Pull Requests. |
| 58 | + |
| 59 | +The upstream [contribution guidelines](https://golang.org/doc/contribute.html) |
| 60 | +include a basic overview of using Gerrit. While the upstream Go Gerrit server |
| 61 | +is different from ours, `codereview.cfg` will configure `git-codereview` to |
| 62 | +send CLs to GerritHub. |
0 commit comments