-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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: unable to pass "--static" to pkgconfig #23875
Comments
This is with the final released version of 1.10? A fix for that went in quite late in the process. |
Yup I just downloaded it from golang.org a few minutes before the report |
I can't recreate the problem. Can you show a complete test case? Thanks. |
After some checking I found out what's wrong. I'm setting --static in multiple files. go/src/cmd/go/internal/work/exec.go Line 939 in f7c2a71
|
That's a loop, though. Assuming this is still a problem for you, I'd still like to see a test case. Thanks. |
Test case is just any 2+ files with --static in the pkgconfig args. main.go
foo.go
|
Change https://golang.org/cl/94896 mentions this issue: |
Hmm...I'm having a similar problem (same error), but maybe it is different enough to be worth describing. I have a project that relies on https://github.com/flier/gohs (golang wrapper around an Intel developed C library called hyperscan). My usage requires that I build the tool that relies on
This worked fine in the past, but now I'm getting:
If I do a |
If it's different enough to be worth describing, it's worth being in its open bug (or at least on a bug that's not closed and thus not tracked). |
@bradfitz - Will do. I only added it hear since it wasn't clear to me if my issue was obviously addressed by the patch that closed this issue already. |
Reopening for 1.10.1. |
CL 94896 OK for Go 1.10.1 |
Change https://golang.org/cl/102779 mentions this issue: |
Change https://golang.org/cl/103155 mentions this issue: |
…t position Fixes #23875 Change-Id: I503af71f44d11cd6b787fef100246b55735614a0 Reviewed-on: https://go-review.googlesource.com/94896 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-on: https://go-review.googlesource.com/103155 Run-TryBot: Andrew Bonventre <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
…nt position Fixes #23875 Change-Id: I503af71f44d11cd6b787fef100246b55735614a0 Reviewed-on: https://go-review.googlesource.com/94896 Run-TryBot: Ian Lance Taylor <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> Reviewed-on: https://go-review.googlesource.com/102779 Run-TryBot: Andrew Bonventre <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?1.10
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?Irrevelent
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I'm trying to build a package that static links C dependencies using pkg-config to set the flags.
Before the cgo security update for go get (1.9.3), doing
#cgo pkg-config: --static SDL2
would tell pkg-config to use the flags for static linking. As --static is a arg passed to pkg-config not the C compiler or linker, there is now no easy way to pass --static to pkg-config.What did you expect to see?
Build succeed
What did you see instead?
Invalid pkg-config package name: --static
The text was updated successfully, but these errors were encountered: