]> Cypherpunks repositories - gostls13.git/commit
cmd/go: use the last -linkmode flag to determine external linking
authorXiangdong Ji <xiangdong.ji@gmail.com>
Sun, 18 Oct 2020 18:43:23 +0000 (11:43 -0700)
committerBryan C. Mills <bcmills@google.com>
Thu, 22 Oct 2020 14:51:57 +0000 (14:51 +0000)
commit61313dab524f2c82add8442e15d87fca5b7103de
tree249c438c7f1eaa55537f1ac5012a5baeacdc6211
parentb4c8b67adcd39da54f210bef5c201b1df8124d73
cmd/go: use the last -linkmode flag to determine external linking

Current linkmode checking in determining package dependencies doesn't
take multiple -linkmode options into consideration, may lead to redundant
dependency on 'runtime/cgo'.

Fixes the problem and adds a testcase.

Change-Id: Iac5ea9fb3ca5ef931201afd0f3441f41f946c919
Reviewed-on: https://go-review.googlesource.com/c/go/+/263497
Trust: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/script/gcflags_patterns.txt