Skip to content

[test-only] Add crosstool-ng based rootfs - #138449

Draft
am11 wants to merge 2 commits into
dotnet:mainfrom
am11:feature/crosstool-ng-rootfs
Draft

am11 wants to merge 2 commits into
dotnet:mainfrom
am11:feature/crosstool-ng-rootfs

Conversation

@am11

@am11 am11 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Testing upstream PR dotnet/dotnet-buildtools-prereqs-docker#1845

Add eng/common/cross/crosstool-ng-build-rootfs.sh, which builds a glibc rootfs for cross-compiling with the host clang, without depending on a Linux distribution's package archive.

The rootfs is only read at build time (headers, crt objects and link-time libraries); nothing in it is executed. That makes it possible to choose every dependency precisely and independently:

  • C/C++ ABI floor: glibc, the GCC runtime (libstdc++, libgcc_s) and the kernel UAPI headers are built from source with crosstool-ng. Their versions set the GLIBC_*/GLIBCXX_* floor of the produced binaries explicitly, instead of inheriting whatever a distro release ships.
  • Other dependencies: OpenSSL, ICU, krb5, lttng-ust (with userspace-rcu) and the LLDB headers are built from pinned upstream tarballs, installing only headers and libraries.
  • Single table: every input is verified by sha256 and listed in one table, where an architecture can override a version, add a dependency or drop one without special casing in the script.

Compared to the Ubuntu-based rootfs, the result contains only what the build reads: about 85 MB (arm64) instead of about 740 MB (Ubuntu-based x64), without the perl, python, gcc/binutils and LLVM packages that apt pulls in but the build never uses.

@dotnet-policy-service dotnet-policy-service Bot added the community-contribution Indicates that the PR has been added by a community member label Nov 28, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
12 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

am11 added 2 commits November 29, 2026 02:14
Add `eng/common/cross/crosstool-ng-build-rootfs.sh`, which builds a glibc rootfs for cross-compiling with the host clang, without depending on a Linux distribution's package archive.

The rootfs is only read at build time (headers, crt objects and link-time libraries); nothing in it is executed. That makes it possible to choose every dependency precisely and independently:

- **C/C++ ABI floor:** glibc, the GCC runtime (`libstdc++`, `libgcc_s`) and the kernel UAPI headers are built from source with [crosstool-ng](https://crosstool-ng.github.io/). Their versions set the `GLIBC_*`/`GLIBCXX_*` floor of the produced binaries explicitly, instead of inheriting whatever a distro release ships.
- **Other dependencies:** OpenSSL, ICU, krb5, lttng-ust (with userspace-rcu) and the LLDB headers are built from pinned upstream tarballs, installing only headers and libraries.
- **Single table:** every input is verified by sha256 and listed in one table, where an architecture can override a version, add a dependency or drop one without special casing in the script.

Compared to the Ubuntu-based rootfs, the result contains only what the build reads: about 85 MB (arm64) instead of about 740 MB (Ubuntu-based x64), without the perl, python, gcc/binutils and LLVM packages that apt pulls in but the build never uses.
@am11
am11 force-pushed the feature/crosstool-ng-rootfs branch from a507f28 to 7f847fc Compare November 29, 2026 00:14
@am11 am11 changed the title Add crosstool-ng based rootfs [test-only] Add crosstool-ng based rootfs Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-Infrastructure community-contribution Indicates that the PR has been added by a community member

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant