diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2020-12-23 19:49:39 -0800 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2021-03-11 21:43:04 +0000 |
| commit | 7fc638d6f1679f2e35862555531bf479c3e5b99c (patch) | |
| tree | 70360705cea1ab8adf672605f5ba2f4724b9b6de /src/runtime/internal | |
| parent | b3896fc331c36a539f825f1f656cef3f9cdffd3f (diff) | |
| download | go-7fc638d6f1679f2e35862555531bf479c3e5b99c.tar.xz | |
cmd: move GOEXPERIMENT knob from make.bash to cmd/go
This CL changes GOEXPERIMENT to act like other GO[CONFIG] environment
variables. Namely, that it can be set at make.bash time to provide a
default value used by the toolchain, but then can be manually set when
running either cmd/go or the individual tools (compiler, assembler,
linker).
For example, it's now possible to test rsc.io/tmp/fieldtrack by simply
running:
GOEXPERIMENT=fieldtrack go test -gcflags=-l rsc.io/tmp/fieldtrack \
-ldflags=-k=rsc.io/tmp/fieldtrack.tracked
without needing to re-run make.bash. (-gcflags=-l is needed because
the compiler's inlining abilities have improved, so calling a function
with a for loop is no longer sufficient to suppress inlining.)
Fixes #42681.
Change-Id: I2cf8995d5d0d05f6785a2ee1d3b54b2cfb3331ca
Reviewed-on: https://go-review.googlesource.com/c/go/+/300991
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
Diffstat (limited to 'src/runtime/internal')
| -rw-r--r-- | src/runtime/internal/sys/arch.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/runtime/internal/sys/arch.go b/src/runtime/internal/sys/arch.go index 3c99a2f7da..f00c55913f 100644 --- a/src/runtime/internal/sys/arch.go +++ b/src/runtime/internal/sys/arch.go @@ -52,3 +52,5 @@ const MinFrameSize = _MinFrameSize // StackAlign is the required alignment of the SP register. // The stack must be at least word aligned, but some architectures require more. const StackAlign = _StackAlign + +var GOEXPERIMENT string // set by cmd/link |
