No description
Christoph Heiss
f9f36fec18
Some checks failed
Continuous Integration / Build mlibc (mlibc) (push) Has been cancelled
Continuous Integration / Build mlibc (mlibc-ansi-only) (push) Has been cancelled
Continuous Integration / Build mlibc (mlibc-static) (push) Has been cancelled
Continuous Integration / Compile sysdeps (dripos) (push) Has been cancelled
Continuous Integration / Compile sysdeps (lemon) (push) Has been cancelled
Continuous Integration / Compile sysdeps (qword) (push) Has been cancelled
Signed-off-by: Christoph Heiss <contact@christoph-heiss.at> |
||
---|---|---|
.github/workflows | ||
abis | ||
ci | ||
libcrypt/src | ||
libdl/src | ||
libm/src | ||
libpthread/src | ||
libresolv/src | ||
librt/src | ||
libutil/src | ||
options | ||
scripts | ||
subprojects | ||
sysdeps | ||
tests | ||
.gitignore | ||
internal-config.h.in | ||
LICENSE | ||
meson.build | ||
meson_options.txt | ||
mlibc-config.h.in | ||
README.md |
mlibc is a C standard library
Official Discord server: https://discord.gg/7WB6Ur3
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:
- Add new
sysdeps/
subdirectorysysdeps/some-new-os/
and ameson.build
to compile it. Integreatesysdeps/some-new-os/meson.build
into the toplevelmeson.build
. - Create ABI headers in
abis/some-new-os/
. Add symlinks insysdeps/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 bysysdeps/some-new-os/meson.build
. - In
sysdeps/some-new-os/
, add code to implement (a subset of) the functions fromoptions/internal/include/mlibc/sysdeps.hpp
. Which subset you need depends on the options thatsysdeps/some-new-os/meson.build
enables.
Local Development
The mlibc
test suite can be run under a Linux host. To do this, first run from the project root:
meson -Dbuild_tests=true build
This will create a build
directory. Then, cd build
and run the tests (showing output) with:
meson test -v