Skip to content

why cgo is not supported? #2757

Closed Answered by hugelgupf
nikitos1550 asked this question in Q&A
Discussion options

You must be logged in to vote

It's possible that cgo could work, but the way gobusybox works involves some rewriting of source, and creating a bunch of stuff in temporary directories as described here. It'd presumably break cgo compilations.

We don't plan to support it ourselves as the mixing of Go and C using cgo bloats binary size (e.g. not that easy to do dead code elimination). Downstream users that need to use C in their initramfs images tend to build a small, statically linked C binary and call it from Go instead.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hugelgupf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants