Closed
Description
Most compilers like GCC would take multiple -ldflags arguments, and concatenate them to produce a list of additional arguments to ld.
go build is not doing so, and uses only the last -ldflags. Fortunately it is not completely that bad, and handles -ldflags ""
(an empty argument after -ldflags) as a no-op, so scripting is still possible.
So the proposal is to concatenate multiple gcflags/ldflags. If no objections - would provide PR.
What version of Go are you using (go version
)?
$ go version go version go1.17.1 darwin/amd64
Does this issue reproduce with the latest release?
yes