aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/dist
diff options
context:
space:
mode:
authorAustin Clements <austin@google.com>2023-06-30 16:33:49 -0400
committerAustin Clements <austin@google.com>2023-08-22 19:18:28 +0000
commitfbcf43c60ba5170309a238b0e42fd5879d419776 (patch)
treee3e2272ba47c261aeaff37dd230bd1873eb51b28 /src/cmd/dist
parent88a6df72c9c056559bda14d88252ba350949bf50 (diff)
downloadgo-fbcf43c60ba5170309a238b0e42fd5879d419776.tar.gz
go-fbcf43c60ba5170309a238b0e42fd5879d419776.zip
cmd/compile,cmd/dist,cmd/go: compute -+ flag from package path
As we did for the asm -compiling-runtime flag, this CL modifies the compiler to compute the -+ (compiling runtime) flag from the package path. Unlike for asm, some tests use -+ explicitly to opt in to runtime restrictions, so we leave the flag, but it's no longer passed by any build tools. This lets us eliminate cmd/go's list of "runtime packages" in favor of the unified objabi.LookupPkgSpecial. It also fixes an inconsistency with dist, which only passed -+ when compiling "runtime" itself. One consequence of this is that the compiler now ignores the -N flag when compiling runtime packages. Previously, cmd/go would strip -N when passing -+ and the compiler would fatal if it got both -N and -+, so the overall effect was that the compiler never saw -N when compiling a runtime package. Now we simply move that logic to disable -N down into the compiler. Change-Id: I4876047a1563210ed122a31b72d62798762cbcf5 Reviewed-on: https://go-review.googlesource.com/c/go/+/521699 Run-TryBot: Austin Clements <austin@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/dist')
-rw-r--r--src/cmd/dist/build.go3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/cmd/dist/build.go b/src/cmd/dist/build.go
index 031a8d9013..193db6f52d 100644
--- a/src/cmd/dist/build.go
+++ b/src/cmd/dist/build.go
@@ -946,9 +946,6 @@ func runInstall(pkg string, ch chan struct{}) {
if gogcflags != "" {
compile = append(compile, strings.Fields(gogcflags)...)
}
- if pkg == "runtime" {
- compile = append(compile, "-+")
- }
if len(sfiles) > 0 {
compile = append(compile, "-asmhdr", goasmh)
}