-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: build fails when setting linker to lld using ldflags #27110
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
Comments
Change https://golang.org/cl/130316 mentions this issue: |
Just ran into a (possibly) related issue when using Go 1.11 to build a
Is 6417e91 slated to be included in a future Go 1.11.1 release? |
@gopherbot please backport to 1.11 |
Backport issue(s) opened: #27293 (for 1.11). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/134057 mentions this issue: |
Some linker flags can actually be input files, which can cause misleading errors when doing the trial link, which can cause the linker to incorrectly decide that the flag is not supported, which can cause the link to fail. Fixes #27510 Updates #27110 Updates #27293 Change-Id: I70c1e913cee3c813e7b267bf779bcff26d4d194a Reviewed-on: https://go-review.googlesource.com/134057 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Lynn Boger <laboger@linux.vnet.ibm.com> Reviewed-by: Damien Neil <dneil@google.com>
This issue is still out with golang 1.11.2, as described by kubernetes/kubernetes#71996. The problem is that the clang lld linker (as of 7.0.0) does not support |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version devel +0b30cf534a Mon Aug 20 23:12:45 2018 +0000 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?
What did you expect to see?
Build succeeds
What did you see instead?
The link command tries to detect whether the
-Wl,--compress-debug-sections=zlib-gnu
flag is supported here:go/src/cmd/link/internal/ld/lib.go
Line 1225 in 89d533e
but does so incorrectly (it doesn't use the provided ldflags, and therefore checks whether the flag is supported by /usr/bin/ld instead of whichever linker the user selected). LLD doesn't currently support
-Wl,--compress-debug-sections=zlib-gnu
, so we get this error.The text was updated successfully, but these errors were encountered: