feat(userland): ported GCC to Stellux as a prebuilt package - #187
Merged
Conversation
An optimizing compiler on the target needs a static musl hosted gcc, which only builds cleanly through the musl targeting patch set that musl-cross-make maintains. The build runs pinned inside a container in two stages, a cross toolchain and then a static native rebuild of itself, with target patches applied only to the native stage since the first stage runs on the build host. Sources download from a mirror that outlasts the flaky primary and cache across builds, and each stage builds from a fresh clone so extraction sets consistent autotools timestamps.
The gcc driver, collect2, and every spawned stage go through libiberty's pex layer, which only knows fork, vfork, and posix_spawn, none of which exist on the target. A patch applied to the native stage only replaces child execution and waiting with proc_create, proc_set_handle, proc_start, and proc_wait, whose status word already matches the wait format. Children begin with just the standard descriptors, so descriptor cleanup logic reduces to installing the redirections.
Heavy tools such as a native compiler toolchain reached the image only by building them on every clone or placing them by hand, and nothing recorded which build of a tool a given kernel tree had been tested against. Packages are reproducible archives rooted at the filesystem root, published on a release, and named in a lock file that pins one release and a checksum per package and architecture, so the pins travel with the kernel sources they belong to and a plain image build stays lean.
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Cursor <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make image PACKAGES="gcc binutils"fetches, verifies, and stages them in seconds, while a plainmake imagestays lean and offline.Made with Cursor