Skip to content

Commit 45517e5

Browse files
committed
_content/doc: update install-source.html with changes from main repo
Copied from Go ff0e93ea3, deleted there in CL 291709. Fixes golang/go#40496. Fixes golang/go#41861. Change-Id: Idb04706ea46b97be69fbeb98637c7ac2e4b54729 Reviewed-on: https://go-review.googlesource.com/c/website/+/291692 Trust: Russ Cox <[email protected]> Run-TryBot: Russ Cox <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
1 parent 6ba27a4 commit 45517e5

File tree

1 file changed

+58
-34
lines changed

1 file changed

+58
-34
lines changed

_content/doc/install-source.html

Lines changed: 58 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
"Path": "/doc/install/source"
44
}-->
55

6-
<p>This topic describes how to build and run Go from source code. To install with an installer, see <a href="/doc/install.html">Download and install</a>.</p>
6+
<p>
7+
This topic describes how to build and run Go from source code.
8+
To install with an installer, see <a href="/doc/install">Download and install</a>.
9+
</p>
710

811
<h2 id="introduction">Introduction</h2>
912

@@ -111,7 +114,7 @@ <h2 id="introduction">Introduction</h2>
111114
Go does not support CentOS 6 on these systems.
112115
</li>
113116
</ul>
114-
117+
115118
</div>
116119

117120
<h2 id="go14">Install Go compiler binaries for bootstrap</h2>
@@ -121,41 +124,32 @@ <h2 id="go14">Install Go compiler binaries for bootstrap</h2>
121124
The scripts that do the initial build of the tools look for a "go" command
122125
in <code>$PATH</code>, so as long as you have Go installed in your
123126
system and configured in your <code>$PATH</code>, you are ready to build Go
124-
from source.
127+
from source.
125128
Or if you prefer you can set <code>$GOROOT_BOOTSTRAP</code> to the
126129
root of a Go installation to use to build the new Go toolchain;
127130
<code>$GOROOT_BOOTSTRAP/bin/go</code> should be the go command to use.</p>
128131

129-
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
130-
131132
<p>
132-
To use a binary release as a bootstrap toolchain, see
133-
<a href="/dl/">the downloads page</a> or use any other
134-
packaged Go distribution.
133+
There are four possible ways to obtain a bootstrap toolchain:
135134
</p>
136135

137-
<h3 id="bootstrapFromSource">Bootstrap toolchain from source</h3>
136+
<ul>
137+
<li>Download a recent binary release of Go.
138+
<li>Cross-compile a toolchain using a system with a working Go installation.
139+
<li>Use gccgo.
140+
<li>Compile a toolchain from Go 1.4, the last Go release with a compiler written in C.
141+
</ul>
138142

139143
<p>
140-
To build a bootstrap toolchain from source, use
141-
either the git branch <code>release-branch.go1.4</code> or
142-
<a href="https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz">go1.4-bootstrap-20171003.tar.gz</a>,
143-
which contains the Go 1.4 source code plus accumulated fixes
144-
to keep the tools running on newer operating systems.
145-
(Go 1.4 was the last distribution in which the toolchain was written in C.)
146-
After unpacking the Go 1.4 source, <code>cd</code> to
147-
the <code>src</code> subdirectory, set <code>CGO_ENABLED=0</code> in
148-
the environment, and run <code>make.bash</code> (or,
149-
on Windows, <code>make.bat</code>).
144+
These approaches are detailed below.
150145
</p>
151146

147+
<h3 id="bootstrapFromBinaryRelease">Bootstrap toolchain from binary release</h3>
148+
152149
<p>
153-
Once the Go 1.4 source has been unpacked into your GOROOT_BOOTSTRAP directory,
154-
you must keep this git clone instance checked out to branch
155-
<code>release-branch.go1.4</code>. Specifically, do not attempt to reuse
156-
this git clone in the later step named "Fetch the repository." The go1.4
157-
bootstrap toolchain <b>must be able</b> to properly traverse the go1.4 sources
158-
that it assumes are present under this repository root.
150+
To use a binary release as a bootstrap toolchain, see
151+
<a href="/dl/">the downloads page</a> or use any other
152+
packaged Go distribution.
159153
</p>
160154

161155
<h3 id="bootstrapFromCrosscompiledSource">Bootstrap toolchain from cross-compiled source</h3>
@@ -196,6 +190,36 @@ <h3 id="bootstrapFromGccgo">Bootstrap toolchain using gccgo</h3>
196190
$ GOROOT_BOOTSTRAP=/usr ./make.bash
197191
</pre>
198192

193+
<h3 id="bootstrapFromSource">Bootstrap toolchain from C source code</h3>
194+
195+
<p>
196+
To build a bootstrap toolchain from C source code, use
197+
either the git branch <code>release-branch.go1.4</code> or
198+
<a href="https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz">go1.4-bootstrap-20171003.tar.gz</a>,
199+
which contains the Go 1.4 source code plus accumulated fixes
200+
to keep the tools running on newer operating systems.
201+
(Go 1.4 was the last distribution in which the toolchain was written in C.)
202+
After unpacking the Go 1.4 source, <code>cd</code> to
203+
the <code>src</code> subdirectory, set <code>CGO_ENABLED=0</code> in
204+
the environment, and run <code>make.bash</code> (or,
205+
on Windows, <code>make.bat</code>).
206+
</p>
207+
208+
<p>
209+
Once the Go 1.4 source has been unpacked into your GOROOT_BOOTSTRAP directory,
210+
you must keep this git clone instance checked out to branch
211+
<code>release-branch.go1.4</code>. Specifically, do not attempt to reuse
212+
this git clone in the later step named "Fetch the repository." The go1.4
213+
bootstrap toolchain <b>must be able</b> to properly traverse the go1.4 sources
214+
that it assumes are present under this repository root.
215+
</p>
216+
217+
<p>
218+
Note that Go 1.4 does not run on all systems that later versions of Go do.
219+
In particular, Go 1.4 does not support current versions of macOS.
220+
On such systems, the bootstrap toolchain must be obtained using one of the other methods.
221+
</p>
222+
199223
<h2 id="git">Install Git, if needed</h2>
200224

201225
<p>
@@ -509,8 +533,8 @@ <h2 id="environment">Optional environment variables</h2>
509533

510534
<p>
511535
Choices for <code>$GOOS</code> are
512-
<code>android</code>, <code>darwin</code> (macOS/iOS),
513-
<code>dragonfly</code>, <code>freebsd</code>, <code>illumos</code>, <code>js</code>,
536+
<code>android</code>, <code>darwin</code>, <code>dragonfly</code>,
537+
<code>freebsd</code>, <code>illumos</code>, <code>ios</code>, <code>js</code>,
514538
<code>linux</code>, <code>netbsd</code>, <code>openbsd</code>,
515539
<code>plan9</code>, <code>solaris</code> and <code>windows</code>.
516540
</p>
@@ -569,6 +593,9 @@ <h2 id="environment">Optional environment variables</h2>
569593
<td></td><td><code>illumos</code></td> <td><code>amd64</code></td>
570594
</tr>
571595
<tr>
596+
<td></td><td><code>ios</code></td> <td><code>arm64</code></td>
597+
</tr>
598+
<tr>
572599
<td></td><td><code>js</code></td> <td><code>wasm</code></td>
573600
</tr>
574601
<tr>
@@ -665,16 +692,13 @@ <h2 id="environment">Optional environment variables</h2>
665692
<code>arm</code> on an x86 system.
666693
</p>
667694

668-
<li><code>$GO386</code> (for <code>386</code> only, default is auto-detected
669-
if built on either <code>386</code> or <code>amd64</code>, <code>387</code> otherwise)
695+
<li><code>$GO386</code> (for <code>386</code> only, defaults to <code>sse2</code>)
670696
<p>
671-
This controls the code generated by gc to use either the 387 floating-point unit
672-
(set to <code>387</code>) or SSE2 instructions (set to <code>sse2</code>) for
673-
floating point computations.
697+
This variable controls how gc implements floating point computations.
674698
</p>
675699
<ul>
676-
<li><code>GO386=387</code>: use x87 for floating point operations; should support all x86 chips (Pentium MMX or later).</li>
677-
<li><code>GO386=sse2</code>: use SSE2 for floating point operations; has better performance than 387, but only available on Pentium 4/Opteron/Athlon 64 or later.</li>
700+
<li><code>GO386=softfloat</code>: use software floating point operations; should support all x86 chips (Pentium MMX or later).</li>
701+
<li><code>GO386=sse2</code>: use SSE2 for floating point operations; has better performance but only available on Pentium 4/Opteron/Athlon 64 or later.</li>
678702
</ul>
679703
</li>
680704

0 commit comments

Comments
 (0)