HOME

TheInfoList



OR:

musl is a
C standard library The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard.ISO/ IEC (2018). '' ISO/IEC 9899:2018(E): Programming Languages - C §7'' Starting from the original ANSI C standard, it was ...
intended for operating systems based on the Linux kernel, released under the MIT License. It was developed by Rich Felker with the goal to write a clean, efficient and standards-conformant libc implementation.


Overview

musl was designed from scratch to allow efficient
static linking In computer science, a static library or statically-linked library is a set of routines, external functions and variables which are resolved in a caller at compile-time and copied into a target application by a compiler, linker, or binder, produc ...
and to have realtime-quality robustness by avoiding race conditions, internal failures on resource exhaustion and various other bad worst-case behaviors present in existing implementations. The dynamic runtime is a single file with stable ABI allowing race-free updates and the static linking support allows an application to be deployed as a single portable binary without significant size overhead. It claims compatibility with the POSIX 2008 specification and the C11 standard. It also implements most of the widely used non-standard Linux,
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berke ...
, and glibc functions. There is partial ABI compatibility with the part of glibc required by
Linux Standard Base The Linux Standard Base (LSB) was a joint project by several Linux distributions under the organizational structure of the Linux Foundation to standardize the software system structure, including the Filesystem Hierarchy Standard used in the Li ...
. Version 1.2.0 has support for (no longer current) Unicode 12.1.0 (while still having full UTF-8 support, more conformant/strict than glibc), and version 1.2.1 "features the new 'mallocng'
malloc C dynamic memory allocation refers to performing manual memory management for dynamic memory allocation in the C programming language via a group of functions in the C standard library, namely , , , and . The C++ programming language includes t ...
implementation, replacing musl's original dlmalloc-like allocator that suffered from fundamental design problems."


Use

Some
Linux distribution A Linux distribution (often abbreviated as distro) is an operating system made from a software collection that includes the Linux kernel and, often, a package management system. Linux users usually obtain their operating system by downloading one ...
s that can use musl as the standard C library include
Alpine Linux Alpine Linux is a Linux distribution designed to be small, simple and secure. Alpine Linux uses musl, BusyBox and OpenRC instead of the more commonly used glibc, GNU Core Utilities and systemd respectively.
, Dragora 3,
Gentoo Linux Gentoo Linux (pronounced ) is a Linux distribution built using the Portage package management system. Unlike a binary software distribution, the source code is compiled locally according to the user's preferences and is often optimized for the ...
, OpenWrt, Sabotage, Morpheus Linux and
Void Linux Void Linux is an independent Linux distribution that uses the X Binary Package System (XBPS) package manager, which was designed and implemented from scratch, and the runit init system. Excluding binary kernel blobs, a base install is composed e ...
. The
seL4 L4 is a family of second-generation microkernels, used to implement a variety of types of operating systems (OS), though mostly for Unix-like, ''Portable Operating System Interface'' (POSIX) compliant types. L4, like its predecessor microkernel ...
microkernel ships with musl. For binaries that have been linked against glibc, gcompat can be used to execute them on musl-based distros.


See also

* Bionic libc *
dietlibc dietlibc is a C standard library released under the GNU General Public License The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, st ...
*
EGLIBC The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. Despite its name, it now also directly supports C++ (and, indirectly, other programming languages). It was started in the 1980s by t ...
* glibc *
klibc In computing, klibc is a minimalistic subset of the standard C library developed by H. Peter Anvin. It was developed mainly to be used during the Linux startup process, and it is part of the early user space, i.e. components used during kernel ...
*
Newlib Newlib is a C standard library implementation intended for use on embedded systems. It is a conglomeration of several library parts, all under free software licenses that make them easily usable on embedded products. It was created by Cygnus ...
*
uClibc __NOTOC__ In computing, uClibc (sometimes written µClibc) is a small C standard library intended for Linux kernel-based operating systems for embedded systems and mobile devices. uClibc was written to support μClinux, a version of Linux n ...


References


External links

*
Comparison of C/POSIX standard library implementations for Linux

Matrix of C/POSIX standard libraries by architecture

Project:Hardened musl on Gentoo wiki
* Rich Felker held a talk at the Embedded Linux Conference (ELC) 2015
ELC 2015 - Transitioning From uclibc to musl for Embedded Development - Rich Felker, Openwall
{{CProLang C standard library Free computer libraries Free software programmed in C Interfaces of the Linux kernel Linux APIs Software using the MIT license