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

cmd/cgo: build failures on go 1.15.7 #43948

Closed
farooquekhan opened this issue Jan 27, 2021 · 2 comments
Closed

cmd/cgo: build failures on go 1.15.7 #43948

farooquekhan opened this issue Jan 27, 2021 · 2 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.

Comments

@farooquekhan
Copy link

farooquekhan commented Jan 27, 2021

What version of Go are you using (go version)?

1.15.7

$ go version

go version go1.15.7 windows/amd64

Does this issue reproduce with the latest release?

Yes

What operating system and processor architecture are you using (go env)?

Windows 10 64 bit

go env Output
$ go env
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\farooque_khan\AppData\Local\go-build
set GOENV=C:\Users\farooque_khan\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\farooque_khan\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\farooque_khan\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=c:\go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=c:\go\pkg\tool\windows_amd64
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\FAROOQ~1\AppData\Local\Temp\go-build155781034=/tmp/go-build -gno-record-gcc-switches

What did you do?

Tried to build this cgo sample from https://golang.org/cmd/cgo/

package main

// typedef int (*intFunc) ();
//
// int
// bridge_int_func(intFunc f)
// {
//		return f();
// }
//
// int fortytwo()
// {
//	    return 42;
// }
import "C"
import "fmt"

func main() {
	f := C.intFunc(C.fortytwo)
	fmt.Println(int(C.bridge_int_func(f)))
	// Output: 42
}

What did you expect to see?

This should built without errors. Builds fine in 1.15.6

What did you see instead?

command-line-arguments

cgo: exec C:\Program: exec: "C:\Program": file does not exist

I reverted to 1.15.6 and it builds fine without errors.

@seankhliao seankhliao changed the title cgo build failures on go 1.15.7 cmd/cgo: build failures on go 1.15.7 Jan 27, 2021
@seankhliao seankhliao added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 27, 2021
@tmthrgd
Copy link
Contributor

tmthrgd commented Jan 27, 2021

This is a duplicate of #43808.

@seankhliao
Copy link
Member

#41400 is still open

@golang golang locked and limited conversation to collaborators Jan 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants