mlibc is a fully featured C standard library designed with portability in mind.
We support a number of architectures (x86-64, AArch64, RISC-V, IA-32, m68k, LoongArch64), and provide a clean syscall abstraction layer for new operating system ports to plug into.
Unlike other portable C standard libraries like newlib, we aim for feature parity with glibc/musl, i.e full pthread support and GNU extensions.
mlibc is capable enough to run a range of software, including Xorg, several Wayland compositors, Mesa, and web browsers like WebKitGTK -- though some features are still missing.
Individual operating systems can opt in or out of certain features as desired; for example POSIX APIs like pthread are gated behind the POSIX 'option', Linux APIs like epoll are gated behind the Linux option, etc.
Official Discord server: https://discord.gg/7WB6Ur3
Official IRC channel: #managarm-mlibc on irc.libera.chat. To find other managarm channels, type /msg alis list managarm.
AUR package (provides mlibc-gcc): https://aur.archlinux.org/packages/mlibc
| Directory | Purpose |
|---|---|
options/ |
(More or less) OS-independent headers and code.options/ is divided into subdirectories that can be enabled or disabled by ports. |
sysdeps/ |
OS-specific headers and code.sysdeps/ is divided into per-port subdirectories. Exactly one of those subdirectories is enabled in each build. |
abis/ |
OS-specific interface headers ("ABI headers"). Those contain the constants and structs of the OS interface. For example, the numerical values of SEEK_SET or O_CREAT live here, as well as structs like struct stat. ABI headers are only allowed to contain constants, structs and unions but no function declarations or logic.abis/ is divided into per-OS subdirectories but this division is for organizational purposes only. Ports can still mix headers from different abis/ subdirectories. |
Ports to new OSes are welcome. To port mlibc to another OS, please follow the mlibc User Guide