Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x/tools/go/loader: assignment count mismatch in Go 1.4 #15045

Closed
nicholascapo opened this issue Mar 31, 2016 · 1 comment
Closed

x/tools/go/loader: assignment count mismatch in Go 1.4 #15045

nicholascapo opened this issue Mar 31, 2016 · 1 comment

Comments

@nicholascapo
Copy link

  1. What version of Go are you using (go version)?
    go version go1.4.3 linux/amd64
  2. What operating system and processor architecture are you using (go env)?
GOARCH="amd64"
GOBIN=""
GOCHAR="6"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/usr/local"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
  1. What did you do?
go get -u golang.org/x/tools/cmd/oracle
  1. What did you expect to see?
    No output, meaning success.
  2. What did you see instead?
# golang.org/x/tools/go/loader
/usr/local/src/golang.org/x/tools/go/loader/cgo14.go:122: assignment count mismatch: 3 = 2

It looks like golang/tools@84e7bc0 didn't also update cgo14.go.

I was able to compile using the below patch, but I am not sure I did it correctly.

diff --git a/go/loader/cgo14.go b/go/loader/cgo14.go
index d484c7d..230d0cb 100644
--- a/go/loader/cgo14.go
+++ b/go/loader/cgo14.go
@@ -119,12 +119,11 @@ func runCgo(bp *build.Package, pkgdir, tmpdir string) (files, displayFiles []str
        _, cgoexeCFLAGS, _, _ := cflags(bp, false)

        if len(bp.CgoPkgConfig) > 0 {
-               pcCFLAGS, pcLDFLAGS, err := pkgConfigFlags(bp)
+               pcCFLAGS, err := pkgConfigFlags(bp)
                if err != nil {
                        return nil, nil, err
                }
                cgoCPPFLAGS = append(cgoCPPFLAGS, pcCFLAGS...)
-               cgoLDFLAGS = append(cgoLDFLAGS, pcLDFLAGS...)
        }

        // Allows including _cgo_export.h from .[ch] files in the package.
@alandonovan
Copy link
Contributor

Go 1.4 is no longer supported.

@golang golang locked and limited conversation to collaborators Apr 13, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants