Skip to content
This repository was archived by the owner on Sep 20, 2026. It is now read-only.

feat: add Linux UAPI and glibc sysroot formulas - #528

Closed
MeteorsLiu wants to merge 1 commit into
xgo-dev:mainfrom
MeteorsLiu:feat/crosscompile-sysroots
Closed

MeteorsLiu wants to merge 1 commit into
xgo-dev:mainfrom
MeteorsLiu:feat/crosscompile-sysroots

Conversation

@MeteorsLiu

Copy link
Copy Markdown
Collaborator

Add source-built Linux UAPI and glibc formulas for an old-libc/new-headers sysroot, plus the requested empty macOS SDK formula.

The implementation includes:

  • Add torvalds/linux to export UAPI headers with the selected ARCH and LLVM=1, starting at Linux v5.7, where Kbuild introduced LLVM selection for both host and target tools.
  • Add bminor/glibc from glibc-2.27, depending on torvalds/linux@v7.2, using the exported UAPI directory for configuration and merging those headers into its staged installation. Preserve glibc's default minimum runtime kernel instead of raising it to the headers version.
  • Build glibc through the existing Autotools helper, stage with install_root, and use the verified --disable-werror and -fcommon settings needed with GCC 13. Install development libraries in /usr/lib and publish --sysroot metadata.
  • Add installed-header architecture checks and a glibc consumer covering allocation, strings, errno, pthreads, and Linux UAPI. Run the consumer with the installed loader and prefer its startup objects and linker scripts over the native compiler's host directories.
  • Add an empty joseluisq/macosx-sdks formula from 14.5; no SDK is downloaded or built. Its actual payload and metadata will be provided through Kodo separately.

Validation against LLAR bd473ea21632d57a4ed21e54144a55d0ee6c1872: all three formulas compile through LLAR's ixgo loader; Linux v5.7 and v7.2 pass fresh-build and cache-hit consumer checks for amd64 and arm64 using an amd64-hosted LLAR Builder; glibc 2.27 passes a full LLAR Builder run and cache-hit consumer check on arm64. Separate GCC 13 builds with the current stable Linux 7.2.4 headers pass build, installation, and installed-loader consumers on amd64 and arm64. The resulting GNU ABI notes retain Linux 3.2.0 and 3.7.0, respectively; those old kernel releases were not boot-tested.

An additional arm64 consumer built with Clang/LLD 19 passes when supplied with matching GCC 7.3 target runtime files from Bootlin. No prebuilt glibc was used in the source-build validation. The host GCC 13 libgcc_s requires GLIBC_2.34/2.35 and cannot simply be reused for a 2.27 ABI baseline.

Draft integration constraints: unmodified glibc 2.27 rejects Clang 19 in its compiler check, so its source build needs GNU bootstrap tools. LLAR's built-in default still requests glibc-2.24; this PR does not change that default or LLAR's bootstrap orchestration. GNU build prerequisites such as gawk and bison, and the Linux-only CI selection for these formulas, are not added to shared workflow/image configuration here. Existing CI selects the greatest upstream tag when tags exist and runs the full platform matrix, so it does not replace the explicit 2.27 validation above. Later glibc versions in the formula range have not been validated in this change.

Reference: Bootlin's glibc staging, glibc 2.27 kernel-header checks, and Linux 5.7 Kbuild.

This establishes the source recipes and their verified libc/UAPI boundary while keeping compiler-runtime provisioning and prebuilt SDK publication explicit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant