Find a file
2019-01-03 06:28:57 +01:00
abis Add some qword syscall definitions 2018-11-24 19:52:56 +01:00
libdl libc: Add interfaces for weston clients 2018-02-10 22:05:53 +01:00
libm Fix ctor/dtor handling in mlibc 2016-11-01 16:23:04 +01:00
libpthread libc: Add interfaces for weston clients 2018-02-10 22:05:53 +01:00
librt libc: Add interfaces for weston clients 2018-02-10 22:05:53 +01:00
libutil libc: Add interfaces for weston clients 2018-02-10 22:05:53 +01:00
options Add qword waitpid sysdep and fix sysdep errno bug 2019-01-03 06:28:57 +01:00
subprojects build: Add wraps for cxxshim and frigg deps. 2018-11-17 16:11:20 +01:00
sysdeps Add qword waitpid sysdep and fix sysdep errno bug 2019-01-03 06:28:57 +01:00
.gitignore build: Add wraps for cxxshim and frigg deps. 2018-11-17 16:11:20 +01:00
configure Fix build 2016-10-15 18:00:09 +02:00
internal-config.h.in ldso: Conditionally mmap() DSO segments 2018-12-21 18:00:27 +01:00
libc.makefile libc: Fix headers for ncurses and nano 2018-06-03 18:36:19 +02:00
meson.build general: Fix some warnings in libc 2018-12-29 13:21:37 +01:00
meson_options.txt meson: Remove dead options 2018-12-16 18:05:29 +01:00
README.md Create README.md 2018-11-18 20:22:40 +01:00
rules.makefile Initial commit 2015-11-15 19:19:53 +01:00
toplevel.makefile libc: Add interfaces for weston clients 2018-02-10 22:05:53 +01:00

mlibc is a C standard library

Design of the library

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 divded 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.

Porting mlibc to a new OS: Ports to new OSes are welcome. To port mlibc to another OS, the following changes need to be made:

  1. Add new sysdeps/ subdirectory sysdeps/some-new-os/ and a meson.build to compile it. Integreate sysdeps/some-new-os/meson.build into the toplevel meson.build.
  2. Create ABI headers in abis/some-new-os/. Add symlinks in sysdeps/some-new-os/include/abi-bits to your ABI headers. Look at existing ports to figure out the ABI headers required for the options enabled by sysdeps/some-new-os/meson.build.
  3. In sysdeps/some-new-os/, add code to implement (a subset of) the functions from options/internal/include/mlibc/sysdeps.hpp. Which subset you need depends on the options that sysdeps/some-new-os/meson.build enables.