aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-06-22 15:49:42 -0400
committerRuss Cox <rsc@golang.org>2017-06-23 00:20:57 +0000
commit53e4b8fc02bb9440a35b20f383c0bc86eece80a6 (patch)
treefb404129d474c22df99d5460661e24c5dc2fa59d /src
parent7c02beb96a601001091c91a9cf0fe4cb6ce459a0 (diff)
downloadgo-53e4b8fc02bb9440a35b20f383c0bc86eece80a6.tar.xz
cmd/go: require -buildmode=c-shared to take one main package
The current behavior is to filter out the non-main packages silently, which is confusing if there are only non-main packages. Instead, report an error unless it's used with a single main package. To be clear, I don't really know what I'm doing. It might be that multiple main packages are allowed, or even that we do want the filtering, but all.bash passes with this change, so I am taking that as a sign that we don't need that extra flexibility. Fixes #15082. Change-Id: I984d0f444a01c0ee0c3cd6646a75527ea99a9ebe Reviewed-on: https://go-review.googlesource.com/46421 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/go/internal/work/build.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/go/internal/work/build.go b/src/cmd/go/internal/work/build.go
index 20f3952d4a..a7949b6ff3 100644
--- a/src/cmd/go/internal/work/build.go
+++ b/src/cmd/go/internal/work/build.go
@@ -288,7 +288,7 @@ func BuildModeInit() {
cfg.ExeSuffix = ".a"
ldBuildmode = "c-archive"
case "c-shared":
- pkgsFilter = pkgsMain
+ pkgsFilter = oneMainPkg
if gccgo {
codegenArg = "-fPIC"
} else {