Musl

Last updated
musl
Developer(s) Rich Felker (dalias) and others
Initial releaseFebruary 11, 2011;13 years ago (2011-02-11) [1]
Stable release
1.2.4 [2] / May 1, 2023;10 months ago (2023-05-01)
Repository
Operating system Linux 2.6 or later
Platform x86, x86_64, ARM, MIPS, Microblaze, PowerPC, powerpc64, x32, riscv64, OpenRISC, s390x, SuperH
Type
License MIT License
Website musl.libc.org

musl is a C standard library intended for operating systems based on the Linux kernel, released under the MIT License. [3] It was developed by Rich Felker to write a clean, efficient, and standards-conformant libc implementation. [4]

Contents

Overview

musl was designed from scratch to allow efficient static linking 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. [4] 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, and glibc functions. [5] There is partial ABI compatibility with the part of glibc required by Linux Standard Base. [6]

Version 1.2.0 has support for (no longer current) Unicode 12.1.0 (while still having full UTF-8 support, [7] more conformant/strict than glibc), and version 1.2.1 "features the new 'mallocng' malloc implementation, replacing musl's original dlmalloc-like allocator that suffered from fundamental design problems." [2]

Use

Some Linux distributions that can use musl as the standard C library include Alpine Linux, [8] Dragora 3, [9] Gentoo Linux, [10] OpenWrt, [11] Sabotage, [12] Morpheus Linux, [13] Chimera Linux, [14] and Void Linux. [15] The seL4 microkernel [16] ships with musl. For binaries that have been linked against glibc, gcompat [17] can be used to execute them on musl-based distros.

See also

Related Research Articles

<span class="mw-page-title-main">GNU Hurd</span> Operating system kernel designed as a replacement for Unix

GNU Hurd is a collection of microkernel servers written as part of GNU, for the GNU Mach microkernel. It has been under development since 1990 by the GNU Project of the Free Software Foundation, designed as a replacement for the Unix kernel, and released as free software under the GNU General Public License. When the Linux kernel proved to be a viable solution, development of GNU Hurd slowed, at times alternating between stasis and renewed activity and interest.

<span class="mw-page-title-main">Minix</span> Unix-like operating system

MINIX is a Unix-like operating system based on a microkernel architecture. Since version 2.0, it has been Portable Operating System Interface (POSIX) compliant.

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.

The GNU C Library, commonly known as glibc, is the GNU Project's implementation of the C standard library. It is a wrapper around the system calls of the Linux kernel for application use. Despite its name, it now also directly supports C++. It was started in the 1980s by the Free Software Foundation (FSF) for the GNU operating system.

The C standard library or libc is the standard library for the C programming language, as specified in the ISO C standard. Starting from the original ANSI C standard, it was developed at the same time as the C library POSIX specification, which is a superset of it. Since ANSI C was adopted by the International Organization for Standardization, the C standard library is also called the ISO C library.

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 malloc, realloc, calloc, aligned_alloc and free.

In computing, POSIX Threads, commonly known as pthreads, is an execution model that exists independently from a programming language, as well as a parallel execution model. It allows a program to control multiple different flows of work that overlap in time. Each flow of work is referred to as a thread, and creation and control over these flows is achieved by making calls to the POSIX Threads API. POSIX Threads is an API defined by the Institute of Electrical and Electronics Engineers (IEEE) standard POSIX.1c, Threads extensions .

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.

<span class="mw-page-title-main">Linux kernel interfaces</span> An overview and comparison of the Linux kernal APIs and ABIs.

The Linux kernel provides multiple interfaces to user-space and kernel-mode code that are used for varying purposes and that have varying properties by design. There are two types of application programming interface (API) in the Linux kernel:

  1. the "kernel–user space" API; and
  2. the "kernel internal" API.

C mathematical operations are a group of functions in the standard library of the C programming language implementing basic mathematical functions. All functions use floating-point numbers in one manner or another. Different C standards provide different, albeit backwards-compatible, sets of functions. Most of these functions are also available in the C++ standard library, though in different headers.

GNU variants are operating systems based upon the GNU operating system. According to the GNU project and others, these also include most operating systems using the Linux kernel and a few others using BSD-based kernels.

systemd Suite of system components for Linux

systemd is a software suite that provides an array of system components for Linux operating systems. The main aim is to unify service configuration and behavior across Linux distributions. Its primary component is a "system and service manager" – an init system used to bootstrap user space and manage user processes. It also provides replacements for various daemons and utilities, including device management, login management, network connection management, and event logging. The name systemd adheres to the Unix convention of naming daemons by appending the letter d. It also plays on the term "System D", which refers to a person's ability to adapt quickly and improvise to solve problems.

Alpine Linux is a Linux distribution designed to be small, simple, and secure. It uses musl, BusyBox, and OpenRC instead of the more commonly used glibc, GNU Core Utilities, and systemd. This makes Alpine one of few Linux distributions not to be based on the GNU Core Utilities.

Bionic is an implementation of the standard C library, developed by Google for its Android operating system. It differs from the GNU C Library (glibc) in being designed for devices with less memory and processor power than a typical Linux system. It is a combination of new code and code from FreeBSD, NetBSD, and OpenBSD released under a BSD license, rather than glibc, which uses the GNU Lesser General Public License. This difference was important in the early days of Android, when static linking was common, and since bionic has its own ABI, it can't be replaced by a different libc without breaking all existing apps.

crypt is a POSIX C library function. It is typically used to compute the hash of user account passwords. The function outputs a text string which also encodes the salt, and identifies the hash algorithm used. This output string forms a password record, which is usually stored in a text file.

libhybris Compatibility layer to run Android drivers on glibc or musl-based Linux systems

libhybris is a compatibility layer for computers running Linux distributions based on the GNU C library or Musl, intended for using software written for Bionic-based Linux systems, which mainly includes Android libraries and device drivers.

Vulkan is a low-level low-overhead, cross-platform API and open standard for 3D graphics and computing. It was intended to address the shortcomings of OpenGL, and allow developers more control over the GPU. It is designed to support a wide variety of GPUs, CPUs and operating systems, it is also designed to work with modern multi-core CPUs.

<span class="mw-page-title-main">Void Linux</span> Independent distribution developed entirely by volunteers

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 entirely of free software.

<span class="mw-page-title-main">Windows Subsystem for Linux</span> Compatibility layer for running Linux binary executables natively on Windows

Windows Subsystem for Linux (WSL) is a feature of Windows that allows developers to run a Linux environment without the need for a separate virtual machine or dual booting. There are two versions of WSL: WSL 1 and WSL 2. WSL 1 was first released on August 2, 2016, and acts as a compatibility layer for running Linux binary executables by implementing Linux system calls on the Windows kernel. It is available on Windows 10, Windows 10 LTSB/LTSC, Windows 11, Windows Server 2016, Windows Server 2019 and Windows Server 2022.

<span class="mw-page-title-main">Genode</span> Free and open-source software operating system

Genode is a free and open-source software operating system (OS) framework consisting of a microkernel abstraction layer and a set of user space components. The framework is notable as one of the few open-source operating systems not derived from a proprietary OS, such as Unix. The characteristic design philosophy is that a small trusted computing base is of primary concern in a security-oriented OS.

References

  1. "musl - obsolete versions". musl-libc.org. 2017-10-31. Retrieved 2018-01-14.>
  2. 1 2 "musl libc Release History". musl.libc.org. Archived from the original on 2021-10-16. Retrieved 2020-08-13.
  3. Rich Felker; et al. (2016-04-29). "COPYRIGHT". Archived from the original on 2021-10-16. Retrieved 2016-09-26.
  4. 1 2 "Introduction to musl". 2016-04-21. Archived from the original on 2021-10-16. Retrieved 2016-09-26.
  5. "Compatibility". wiki.musl-libc.org. 2014-05-27. Archived from the original on 2021-10-16. Retrieved 2016-09-26.
  6. "Comparison of C/POSIX standard library implementations for Linux". www.etalabs.net. Archived from the original on 2021-10-16.
  7. "musl libc - Functional differences from glibc". wiki.musl-libc.org. Archived from the original on 2021-10-16. Retrieved 2020-08-13.
  8. "About". Alpine Linux. Retrieved 18 June 2022.
  9. Larabel, Michael (30 September 2018). "Dragora 3.0 Alpha 2 Released As One Of The Libre GNU/Linux Platforms". Phoronix. Phoronix Media. Retrieved 18 June 2022.
  10. Gentoo Authors (20 July 2021). "Additional stage downloads for amd64, ppc, x86, arm available". Gentoo Linux. Retrieved 18 June 2022.
  11. Fietkau, Felix (16 Jun 2015). "OpenWrt switches to musl by default". Archived from the original on 28 July 2015.
  12. README.md on GitHub
  13. "morpheus". Archived from the original on 2021-10-16. Retrieved 2018-06-15.
  14. "Chimera Linux - About". Chimera Linux. Retrieved 2023-05-10.
  15. "Enter the void". Void Linux. Retrieved 18 June 2022.
  16. seL4/musllibc, seL4 microkernel and related repositories, 2020-08-30, archived from the original on 2021-10-16, retrieved 2020-09-05
  17. "Adélie Linux / gcompat". GitLab. Archived from the original on 2021-10-16. Retrieved 2019-10-21.