No description
Find a file
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
sysdeps/squiid: Fix sys/wait.h header macros
Signed-off-by: Christoph Heiss <contact@christoph-heiss.at>
2022-01-23 16:44:36 +01:00
.github/workflows github: run tests with -v 2021-06-12 16:43:48 +01:00
abis sysdeps/squiid: Fix sys/wait.h header macros 2022-01-23 16:44:36 +01:00
ci ci: disable linux option on ansi only 2021-10-24 13:18:46 +02:00
libcrypt/src libcrypt: Add a dummy libcrypt to satisfy shadow 2021-01-12 21:18:33 +01:00
libdl/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libm/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libpthread/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libresolv/src meta: Build an empty libresolv to satisfy some programs 2021-01-14 20:48:51 +01:00
librt/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
libutil/src Remove unused makefiles 2019-02-20 18:59:22 +01:00
options Merge pull request #273 from Dennisbonke/hexchat 2021-10-26 12:04:50 +02:00
scripts scripts: add abi-link.sh script 2020-08-29 12:31:13 +02:00
subprojects build: Add wraps for cxxshim and frigg deps. 2018-11-17 16:11:20 +01:00
sysdeps sysdeps/squiid: Fix sys/wait.h header macros 2022-01-23 16:44:36 +01:00
tests posix/glibc: implement ffs(), ffsl(), ffsll() and add tests for them 2021-10-09 00:56:59 +02:00
.gitignore qword: Move mount to own header 2019-12-29 09:33:35 +01:00
internal-config.h.in meta: add mlibc-config.h and replace bit/features.h 2021-10-24 13:18:45 +02:00
LICENSE Update LICENSE 2020-01-22 19:13:46 +01:00
meson.build meson.build: Add squiid host sysdeps 2021-10-28 12:38:00 +02:00
meson_options.txt meson.build: fix disable_linux_headers 2021-10-27 18:16:54 +02:00
mlibc-config.h.in meson.build: make glibc option optional 2021-10-24 13:18:46 +02:00
README.md docs: Add local development instructions 2021-05-17 22:41:37 +01:00

mlibc is a C standard library

Continuous Integration

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:

  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.

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