You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's possible that someone using a response file is doing so because they need to avoid some sort of limitation on e.g. argv (as often seen in on Windows). So with that in mind, I would propose the following:
Read the content of response files given by LDFLAGS
When necessary, construct a response file consisting of the appropriate flags within the union of those supplied directly and those given by the response file.
That way we'd fix this particular error, and we'd fix #18468 at the same time.
If you're curious, I ran into this problem while playing with Bazel, where I was given a response file in my build. In-lining the response file into LDFLAGS resulted in a successful compilation.
ianlancetaylor
changed the title
cgo compilation fails when LDFLAGS refers to a response file
cmd/go: cgo compilation fails when LDFLAGS refers to a response file
Nov 3, 2017
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?What did you do?
You can reproduce by compiling the following files like so:
repro.c
repro.params
main.go
What did you expect to see?
I expected the program to compile successfully.
What did you see instead?
If the response file includes any shared libraries, you'll see errors like:
Otherwise you'll see "multiple definition" errors like:
The text was updated successfully, but these errors were encountered: