A C library that compiles programs into single portable executables that run natively on Linux, Mac, Windows, and BSD.
Cosmopolitan Libc is a C library and toolchain that compiles C/C++ programs into single, portable executables capable of running natively on multiple operating systems without modification. It solves the problem of platform-specific builds by creating polyglot binaries that work on Linux, macOS, Windows, and BSD systems with minimal footprint.
C/C++ developers and system programmers who need to distribute binaries across diverse operating systems without maintaining separate builds or relying on interpreters.
Developers choose Cosmopolitan Libc for its unique ability to produce truly portable native binaries with no runtime overhead, combining the performance of C with the cross-platform convenience of languages like Java.
build-once run-anywhere c library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Compiles C/C++ into a single polyglot executable that runs natively on six major OSes, eliminating the need for separate builds or interpreters, as stated in the GitHub description.
Supports build modes like 'tiny' and 'tinylinux' to produce executables as small as 12KB, ideal for embedded tools, detailed in the README's build modes section.
Includes --strace for system call logging and --ftrace for function call tracing directly in the runtime, with environment variable support for output redirection.
Works with standard build systems like autotools via the cosmocc compiler, allowing easy integration into existing C/C++ workflows, as shown in the getting started examples.
Requires manual steps like binfmt_misc registration on Linux and WSL configuration, which can be error-prone and platform-specific, as noted in the platform notes.
May not support all third-party libraries or APIs, especially those reliant on platform-specific features, limiting use in library-heavy projects.
Focused on command-line and system tools, lacking native support for graphical applications, which restricts its use for desktop software.