go: cmd/cgo: go 1.9.4 cgo issue: invalid flag in #cgo LDFLAGS

Please answer these questions before submitting your issue. Thanks!

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

go 1.9.4

Does this issue reproduce with the latest release?

yes

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

macOS High Sierra 10.13.3 / amd64

What did you do?

go build programusingcgo.go

What did you expect to see?

successful building process (built fine with go 1.9.3 and earlier versions)

What did you see instead?

$go build programusingcgo.go github.com/samplepkg: invalid flag in #cgo LDFLAGS: github.com/samplepkg/mylib_darwin_amd64.a $

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (11 by maintainers)

Commits related to this issue

Most upvoted comments

workaround for github.com/miekg/pkcs11 on Linux - CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed' go install (same for go test)

@raydac andlabs/ui must be updated to cope with the new Go release. I’ve opened a bug (andlabs/ui#268).

@susugagalala we need to see the #cgo LDFLAGS line that is rejected by the compiler.