Repository navigation
Conversation
`crosstool-ng-build-rootfs.sh --libc musl` builds the rootfs with musl instead of glibc. The GCC triple uses the `alpine` vendor (for example `x86_64-alpine-linux-musl`), which is how `toolchain.cmake` recognizes a musl rootfs, and the rootfs gets `etc/os-release` with `ID=alpine` and a `usr/bin/ldd` link to musl's `libc.so`, which is how CMake, `init-distro-rid.sh` and NativeAOT detect musl. musl versions follow the current Alpine based images: 1.2.3 by default and 1.2.5 for riscv64 and loongarch64. Table rows can now be specific to a C library (`<arch>-<libc>` and `*-<libc>`). musl uses Linux 6.1 UAPI headers because the 4.19 arm64 `asm/ptrace.h` pulls in `asm/sigcontext.h`, which redefines types that musl's `bits/signal.h` already defines. The net12.0 Azure Linux 4.0 musl cross images (amd64, arm, arm64, loongarch64, riscv64) now build their rootfs with it instead of `build-rootfs.sh` with Alpine. Co-authored-by: Cursor <cursoragent@cursor.com>
The runtime uses the loongarch64 signal context definitions (`FPU_CTX_MAGIC`, `struct sctx_info`, `struct fpu_context`) that musl added in 1.2.6. It also matches the musl version in the current Alpine edge based loongarch64 image. Co-authored-by: Cursor <cursoragent@cursor.com>
The strip step passed every `*.so*`, `*.a` and `*.o` file to a single `llvm-strip` call. Some of them are linker scripts (`libc.so`, `libpthread.so`, `libm.a`, ...), and `llvm-strip` stops at the first file that isn't an object, so everything after it kept its debug info. The error was hidden, and how much got stripped depended on `find` order. Strip only ELF objects and archives instead. On Ubuntu 24.04 this takes the x64 rootfs from 200 MB to 92 MB, arm64 from 213 MB to 87 MB and riscv64 from 212 MB to 138 MB. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
crosstool-ng-build-rootfs.sh --libc muslbuilds the rootfs with musl instead of glibc. The GCC triple uses thealpinevendor (for examplex86_64-alpine-linux-musl), which is howtoolchain.cmakerecognizes a musl rootfs, and the rootfs getsetc/os-releasewithID=alpineand ausr/bin/lddlink to musl'slibc.so, which is how CMake,init-distro-rid.shand NativeAOT detect musl.musl versions follow the current Alpine based images: 1.2.3 by default and 1.2.5 for riscv64 and loongarch64. Table rows can now be specific to a C library (
<arch>-<libc>and*-<libc>). musl uses Linux 6.1 UAPI headers because the 4.19 arm64asm/ptrace.hpulls inasm/sigcontext.h, which redefines types that musl'sbits/signal.halready defines.The net12.0 Azure Linux 4.0 musl cross images (amd64, arm, arm64, loongarch64, riscv64) now build their rootfs with it instead of
build-rootfs.shwith Alpine.