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/link: linker should fail quickly when external link mode is not supported #34373

Open
jeremyfaller opened this issue Sep 18, 2019 · 3 comments
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@jeremyfaller
Copy link
Contributor

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

HEAD

Does this issue reproduce with the latest release?

yes

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

go env Output
darwin, 386

What did you do?

While investigating Issue 33808 I discovered that external linking doesn't work in 32bit darwin.

What did you expect to see?

Linker should fail quickly when trying to do an external link.

What did you see instead?

Linker calls external linker, external linker fails.

CC @cherrymui

@jeremyfaller jeremyfaller self-assigned this Sep 18, 2019
@jeremyfaller jeremyfaller changed the title cmd/link Linker fail quickly when external link mode is not supported cmd/link Linker should fail quickly when external link mode is not supported Sep 18, 2019
@jeremyfaller jeremyfaller changed the title cmd/link Linker should fail quickly when external link mode is not supported cmd/link Llinker should fail quickly when external link mode is not supported Sep 18, 2019
@jeremyfaller jeremyfaller changed the title cmd/link Llinker should fail quickly when external link mode is not supported cmd/link linker should fail quickly when external link mode is not supported Sep 18, 2019
@agnivade agnivade changed the title cmd/link linker should fail quickly when external link mode is not supported cmd/link: linker should fail quickly when external link mode is not supported Sep 19, 2019
@agnivade agnivade added the NeedsFix The path to resolution is known, but the work has not been done. label Sep 19, 2019
@laboger
Copy link
Contributor

laboger commented Oct 2, 2019

External linking is supported on ppc64le, but not on ppc64. If we try to link externally we see this:

go build -ldflags '-linkmode=external' hello.go
# command-line-arguments
/home/boger/golang/base/go/pkg/tool/linux_ppc64/link: external linking not supported for linux/ppc64

@jeremyfaller
Copy link
Contributor Author

Thanks, @laboger. The problem was discovered with darwin/32-bit (which for recent versions of darwin don't support external linking), and was filed as a generic bug. Thanks for checking PPC.

@toshywoshy
Copy link

Not sure if this helps, but I have it working with CGO_ENABLED=1

CGO_ENABLED=1 go build -ldflags '-linkmode=external' hello.go

This compiles and works for my compiled version of Golang on ppc64 BE as described in the links here below
Source link
https://git.powerel.org/powerel7/base/src/branch/master/SPECS/golang.spec
https://git.powerel.org/powerel7/base/src/branch/master/SOURCES/golang-1.16-ppc64-linker.patch
Binary link
https://mirror0.powerel.org/pel/7/power8/ppc64/base/packages/golang-1.16.5-1.pel7.ppc64.rpm
These are for PowerEL 7 ppc64 on IBM POWER8

@jeremyfaller jeremyfaller removed their assignment Mar 23, 2022
@prattmic prattmic added this to the Backlog milestone May 20, 2022
@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
Development

No branches or pull requests

6 participants