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

proposal: go build static when cgo use libc #65297

Closed
jokemanfire opened this issue Jan 26, 2024 · 1 comment
Closed

proposal: go build static when cgo use libc #65297

jokemanfire opened this issue Jan 26, 2024 · 1 comment
Labels
Milestone

Comments

@jokemanfire
Copy link

Proposal Details

Now I use 'go build ' to compile static program , when the program use cgo(It use some libc fuction),
I do like this
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CGO_LDFLAGS=“-static” go build -a -v
It use libc default , but libc's static link is not static really, it use dynamic library.
May go build point the static flag, It can build static really, use like musl default?
No need for me to specify like this:
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 CC=x86_64-linux-musl-gcc CGO_LDFLAGS=“-static” go build -a -v
It could?

@gopherbot gopherbot added this to the Proposal milestone Jan 26, 2024
@seankhliao
Copy link
Member

Duplicate of #26492

@seankhliao seankhliao marked this as a duplicate of #26492 Jan 26, 2024
@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2024
@gabyhelp gabyhelp mentioned this issue Oct 28, 2024
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants