Navigation Menu

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: provide a way to always use external linking if cgo is used #43525

Open
mwhudson opened this issue Jan 5, 2021 · 3 comments
Open
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@mwhudson
Copy link
Contributor

mwhudson commented Jan 5, 2021

This came up as a potential solution for #43505 but I've wanted it for other reasons too (mostly because of other tools like patchelf that rely on implementation details of more common linkers): I would like a way to always use external linking if cgo is used, or to put it another way, never use internal linking to generate a dynamically linked binary. -linkmode and GO_EXTLINK_ENABLED control aspects of this behaviour but can't be used to get what I want.

@toothrot toothrot added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jan 8, 2021
@toothrot
Copy link
Contributor

toothrot commented Jan 8, 2021

@cherrymui
Copy link
Member

Could you explain why -linkmode=external doesn't do what you want? It will use external linking even if cgo is not used, but that doesn't seem a big problem.

@mwhudson
Copy link
Contributor Author

If you always external link, you always get a dynamic executable. I wouldn't mind that, but I thinks some other people might.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 13, 2022
@seankhliao seankhliao added this to the Unplanned milestone Aug 27, 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. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Status: Triage Backlog
Development

No branches or pull requests

5 participants