Skip to content

Export a self-consistent drop-in sysroot per arch#5

Merged
lacraig2 merged 1 commit into
mainfrom
feat/dropin-sysroot
Jun 9, 2026
Merged

Export a self-consistent drop-in sysroot per arch#5
lacraig2 merged 1 commit into
mainfrom
feat/dropin-sysroot

Conversation

@lacraig2

@lacraig2 lacraig2 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

penguin compiles per-project init.d/*.c drop-ins against a per-arch sysroot needing crt startup objects + libc.so + libgcc_s.so.1 + the ld-musl loader. The crt and the libc must come from the same musl toolchain; pairing the embedded-toolchains crt with penguin-tools' nixpkgs-musl libc makes the drop-in crash at startup (this is what broke penguin's per-arch tests when the integration overwrote the system dylibs).

This stages igloo_static/sysroots/<arch>/lib/ in each bundle with:

  • the crt objects (Scrt1.o, crti.o, crtn.o, crtbeginS.o, crtendS.o) resolved from this arch's own cross cc via -print-file-name, and
  • libc.so/libgcc_s.so.1 symlinked into the matching dylibs/<arch>/.

That gives penguin a self-consistent drop-in toolchain sourced entirely from penguin-tools, so it can drop both the embedded-toolchains crt and hyperfs. Verified the armel bundle stages all five crt objects (correct ARM relocatable ELF) with libc/libgcc resolving into dylibs/armel.

Follow-up (penguin side): point the sysroots stage at sysroots/<arch>, update DYLIB_DIRS to canonical names, remove the hyperfs download.

penguin compiles per-project init.d/*.c drop-ins against a per-arch
sysroot: crt startup objects + libc.so + libgcc_s.so.1 + the ld-musl
loader. Today the crt comes from the embedded-toolchains image while the
libc comes from the dylibs, and those must be the same musl toolchain --
pairing embedded-toolchains crt with penguin-tools' nixpkgs musl libc
makes the drop-in crash at startup.

Stage igloo_static/sysroots/<arch>/lib/ in each bundle with the crt
objects (Scrt1.o, crti.o, crtn.o, crtbeginS.o, crtendS.o) resolved from
this arch's own cross cc via -print-file-name, plus libc.so/libgcc_s.so.1
symlinked into the matching dylibs dir. This lets penguin source the
whole drop-in toolchain from penguin-tools and drop both the
embedded-toolchains crt and hyperfs.

Verified the armel bundle stages all five crt objects (correct ARM
relocatable ELF) with libc/libgcc resolving into dylibs/armel.
@lacraig2 lacraig2 merged commit 30b7d61 into main Jun 9, 2026
1 check passed
@lacraig2 lacraig2 deleted the feat/dropin-sysroot branch June 9, 2026 00:14
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