mlibc
- Replaces
musl - Depends on
friggwhich optionally depends ongtestandmimalloc -Duse_freestnd_hdrs=enabledis required forfriggto properly include its headers given that-nostdincis being passed- Requires
-Dwrap_mode=nodownloadbe removed as it pullsfriggand the freestanding headers when building which renders the build not fully offline - Does not support
-z,now - Depends on static
libgcc.afor__mulsc3and__muldc3forx86-64(even with-Dlibgcc_dependency=false) gccdoes not recognizemlibcwithout updatingconfig.sub
Experiments with mlibc version 6.3.1
Section titled “Experiments with mlibc version 6.3.1”- The following tuple was used
x86_64-linux-mlibcfor bothhostandtarget;mlibcis already niche enough to drivegccinto thinking we are cross-compiling which did not require anx86_64-glaucus-linux-mlibctuple - Both
radandmeson.crosswere updated to use the above tuple - Build order:
linux-headers # required as mlibc-headers include headers from the kernel)
mlibc-headers "$core"/muon/files/glaucus-meson \ --cross-file="$core"/muon/files/meson.cross \ -Dheaders_only=true \ -Dlinux_kernel_headers="$cross/usr/include" \ build-headers
binutilsgcc # required passing `--disable-libgomp` and disabling most of `libstdcxx` options to build # for static libgcc, `CFLAGS_FOR_TARGET="-pipe -O0 -I$cross/usr/include"` was passed
mlibc LDFLAGS="-Wl,$toolchain/lib/gcc/$host/15.2.0/libgcc.a" \ "$core"/muon/files/glaucus-meson \ --cross-file="$core"/muon/files/meson.cross \ -Dno_headers=true \ -Dlibgcc_dependency=false \ -Dlinux_kernel_headers="$cross/usr/include" \ -Duse_freestnd_hdrs=enabled \ -Dld_library_name=ld-linux-$nom \ build
libgcclibstdc++-v3- The following were patched to support
mlibc:
gcc/config/linux.hgcc/config.gcclibstdc++-v3/config/os/gnu-linux/os_defines.hlibstdc++-v3/configure- Requires updating the
config.subs of every project being built for now to recognizemlibc - Breakages early on in
crosswithnetbsd-cursesandskalibs - Large
libc.sosize4.2 Maftertoolchainis built (compared tomusl) - Very promising compared to other alternative C libraries, but not ready yet
References
Section titled “References”- https://github.com/LittleCodingFox/ToastOS
- https://github.com/managarm/bootstrap-managarm
- https://github.com/managarm/frigg
- https://github.com/managarm/managarm
- https://github.com/managarm/mlibc
- https://github.com/managarm/mlibc-crossers
- https://github.com/mathewnd/astral
- https://github.com/no92/linux-mlibc