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/go: -buildmode=shared and cgo and -compiler gccgo don't work together #15885

Closed
mwhudson opened this issue May 30, 2016 · 2 comments
Closed

Comments

@mwhudson
Copy link
Contributor

This combination has probably never worked correctly, but my fix for #11739 broke it harder:

$ cat $GOPATH/src/pkgconfigcgo/p.go
package pkgconfigcgo

// #cgo pkg-config: libpng
// #include <png.h>
import "C"

func V() uint32 {
    return uint32(C.png_access_version_number())
}
$ go build -buildmode=shared -compiler gccgo pkgconfigcgo
# /tmp/go-build393723771/libpkgconfigcgo.so
/opt/opensource/gopath/pkg/gccgo_linux_amd64_fPIC/libpkgconfigcgo.a: member /opt/opensource/gopath/pkg/gccgo_linux_amd64_fPIC/libpkgconfigcgo.a(_cgo_flags) in archive is not an object
collect2: error: ld returned 1 exit status

gccgo's ldShared() needs to do (at least) some of the tricks its ld() method does wrt _cgo_flags and so on.

No rush for 1.7 – it's more important to me to get a fix into gccgo in Ubuntu.

@gopherbot
Copy link

CL https://golang.org/cl/23533 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/23537 mentions this issue.

@golang golang locked and limited conversation to collaborators May 31, 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

2 participants