managarm/mlibc logo

managarm/mlibc

Free

Portable C standard library

FreeFree tier
Type
Open Source

About managarm/mlibc

mlibc is a fully featured, portable C standard library designed for operating system development. It supports multiple architectures (x86-64, AArch64, RISC-V, IA-32, m68k, LoongArch64) and provides a clean syscall abstraction layer for easy porting to new operating systems. Unlike minimal alternatives like newlib, mlibc aims for feature parity with glibc and musl, including full pthread support and GNU extensions. It is capable of running complex software such as Xorg, Wayland compositors, Mesa, and WebKitGTK. The library is modular, with OS-independent code in 'options/', OS-specific code in 'sysdeps/', and ABI headers in 'abis/'. Ports can enable or disable features via Meson build options. mlibc is open source and has an active community on Discord.

Key Features

Portable across x86-64, AArch64, RISC-V, IA-32, m68k, LoongArch64 architectures
Clean syscall abstraction layer for easy porting to new operating systems
Feature parity with glibc and musl, including full pthread support and GNU extensions
Capable of running Xorg, Wayland compositors, Mesa, and WebKitGTK
Modular design with OS-independent options/ and OS-specific sysdeps/ directories
Meson-based build system with configurable options (headers_only, build_tests, etc.)
Active community with official Discord server

Pros & Cons

Pros
  • Highly portable across multiple architectures and operating systems
  • Feature-rich with support for modern standards (GNU extensions, pthreads)
  • Modular design allows OS ports to enable only needed features
  • Active development and community support via Discord
  • Able to run complex real-world software (X11, Wayland, Mesa, WebKit)
Cons
  • Some features are still missing compared to glibc or musl
  • New ports are recommended to pin a specific release to avoid breakage from master changes
  • Build system uses Meson, which may be a barrier for contributors unfamiliar with it
  • Documentation (user guide) is referenced but not directly included in the repository

Best For

Providing a standard C library for custom or research operating systemsPorting existing POSIX/Linux applications to new OS environmentsEmbedding in operating system kernels that require a full C libraryDeveloping and testing system-level software with glibc-compatible APIs

FAQ

What architectures does mlibc support?
mlibc supports x86-64, AArch64, RISC-V, IA-32, m68k, and LoongArch64.
Is mlibc compatible with glibc?
mlibc aims for feature parity with glibc and musl, including full pthread support and GNU extensions, but some features are still missing.
How can I port mlibc to a new operating system?
Follow the mlibc User Guide. It is recommended to pin a specific release or commit rather than building from master to avoid internal breaking changes.
Is mlibc free to use?
Yes, mlibc is open source and free. It is hosted on GitHub under the managarm organization.