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: Can't link to static library anymore #23807

Closed
wheelerlaw opened this issue Feb 13, 2018 · 2 comments
Closed

cmd/go: Can't link to static library anymore #23807

wheelerlaw opened this issue Feb 13, 2018 · 2 comments

Comments

@wheelerlaw
Copy link

wheelerlaw commented Feb 13, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version go1.9.4 linux/amd64

Does this issue reproduce with the latest release?

Yes

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

GOARCH="amd64"
GOOS="linux"

What did you do?

git clone https://github.com/wheelerlaw/go-memory-module.git
make

If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.

What did you expect to see?

On go 1.9.2 (same OS/arch), the file compiles with no problems.

What did you see instead?

I updated to 1.9.4, and I receive this error:

go build command-line-arguments: invalid flag in #cgo LDFLAGS: MemoryModule/build/MemoryModule.a

Project here: https://github.com/wheelerlaw/go-memory-module
I know this has something to do with #23672, but it does not seem that *.a files are whitelisted (or if they are, it is not working).

@glycerine
Copy link

@wheelerlaw If you read through the entirety #23672 and #23749 you'll come to understand that this was an oversight that will be fixed in a shortly-to-be-released go1.9.5. For .a files, the temporary workaround is to add this to your ~/.bashrc / current environment.

export CGO_LDFLAGS_ALLOW='.*\.a$'

@mvdan
Copy link
Member

mvdan commented Feb 13, 2018

Closing as duplicate, like @glycerine pointed out.

@mvdan mvdan closed this as completed Feb 13, 2018
@mikioh mikioh changed the title Can't link to static library anymore cmd/go: Can't link to static library anymore Feb 21, 2018
@golang golang locked and limited conversation to collaborators Feb 21, 2019
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