]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/asm, cmd/compile, doc: document -spectre flags
authorRuss Cox <rsc@golang.org>
Thu, 4 Jun 2020 20:20:39 +0000 (16:20 -0400)
committerAustin Clements <austin@google.com>
Fri, 5 Jun 2020 16:54:48 +0000 (16:54 +0000)
Most of the docs are in the new wiki page
https://golang.org/wiki/Spectre.

Updates #37419.

Change-Id: I6e8f76670593c089de895e1665b41d874f879df9
Reviewed-on: https://go-review.googlesource.com/c/go/+/236599
Reviewed-by: Austin Clements <austin@google.com>
doc/go1.15.html
src/cmd/asm/doc.go
src/cmd/compile/doc.go

index 7a1924227c0c9ca9576ece0121fd18e2401e3da7..d17888732b595fcbef9ae4731efaf2dbbeffceb5 100644 (file)
@@ -246,7 +246,11 @@ TODO
 </p>
 
 <p><!-- CL 222661 -->
-  TODO: -spectre flags
+  Go 1.15 adds a <code>-spectre</code> flag to both the
+  compiler and the assembler, to allow enabling Spectre mitigations.
+  These should almost never be needed and are provided mainly as a
+  “defense in depth” mechanism.
+  See the <a href="https://github.com/golang/go/wiki/Spectre">Spectre wiki page</a> for details.
 </p>
 
 <h2 id="linker">Linker</h2>
@@ -276,7 +280,7 @@ TODO
   These changes are part of a multi-release project
   to <a href="https://golang.org/s/better-linker">modernize the Go
   linker</a>, meaning that there will be additional linker
-  improvements expected in future releases. 
+  improvements expected in future releases.
 </p>
 
 <h2 id="library">Core library</h2>
index 8bf0acac25f79774f65e45bdb116e395b81ae513..4a0c785aad4192d7c5eea5160d410bdb17fae07c 100644 (file)
@@ -33,14 +33,17 @@ Flags:
                Dump instructions as they are parsed.
        -dynlink
                Support references to Go symbols defined in other shared libraries.
+       -gensymabis
+               Write symbol ABI information to output file. Don't assemble.
        -o file
                Write output to file. The default is foo.o for /a/b/c/foo.s.
        -shared
                Generate code that can be linked into a shared library.
+       -spectre list
+               Enable spectre mitigations in list (all, ret).
        -trimpath prefix
                Remove prefix from recorded source file paths.
-       -gensymabis
-               Write symbol ABI information to output file. Don't assemble.
+
 Input language:
 
 The assembler uses mostly the same syntax for all architectures,
index 36dd4bb5cd08a3150544ad3b70b2902a15157edc..46d47220866a4536e5c9b5c099e4e277b4e1cf84 100644 (file)
@@ -107,6 +107,8 @@ Flags:
                Warn about composite literals that can be simplified.
        -shared
                Generate code that can be linked into a shared library.
+       -spectre list
+               Enable spectre mitigations in list (all, index, ret).
        -traceprofile file
                Write an execution trace to file.
        -trimpath prefix