Skip to content

feat(userland): ported GCC to Stellux as a prebuilt package - #187

Merged
FlareCoding merged 13 commits into
masterfrom
pr/gcc-port
Sep 3, 2026
Merged

feat(userland): ported GCC to Stellux as a prebuilt package#187
FlareCoding merged 13 commits into
masterfrom
pr/gcc-port

Conversation

@FlareCoding

Copy link
Copy Markdown
Owner

Summary

  • Stellux had no native compiler beyond tcc, and the toolchain heavy enough to be one (GCC, binutils) could only reach the image by building it for an hour on every clone or placing it by hand. A static GCC 14.3 toolchain now runs natively on both architectures and compiles C and C++ on the target, backed by a real invocation path in argv[0], user stacks sized to their arguments, and GCC's process spawning routed through the process API.
  • Heavy Stellux programs are now packages: reproducible archives built in a pinned container by a manually dispatched workflow, published on a GitHub release, and pinned per kernel tree in packages/packages.lock. make image PACKAGES="gcc binutils" fetches, verifies, and stages them in seconds, while a plain make image stays lean and offline.
  • The host-side binutils cross-build is gone; the binutils package is the same build the compiler uses, so one version of the tools exists everywhere.

Made with Cursor

FlareCoding and others added 12 commits September 2, 2026 22:27
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.
cursor[bot]

This comment was marked as resolved.

@FlareCoding
FlareCoding merged commit f8168be into master Sep 3, 2026
19 checks passed
@FlareCoding
FlareCoding deleted the pr/gcc-port branch September 3, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant