{"id":13599910,"url":"https://github.com/redox-os/relibc","last_synced_at":"2025-06-25T19:05:48.344Z","repository":{"id":49802510,"uuid":"123522329","full_name":"redox-os/relibc","owner":"redox-os","description":"Mirror of https://gitlab.redox-os.org/redox-os/relibc","archived":false,"fork":false,"pushed_at":"2025-06-25T15:17:30.000Z","size":7065,"stargazers_count":903,"open_issues_count":23,"forks_count":61,"subscribers_count":36,"default_branch":"master","last_synced_at":"2025-06-25T16:34:13.361Z","etag":null,"topics":["libc","libredox","linux","posix","redox"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/redox-os.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-03-02T02:58:07.000Z","updated_at":"2025-06-25T15:17:34.000Z","dependencies_parsed_at":"2024-01-14T04:45:35.600Z","dependency_job_id":"8252f2b7-bde1-4abb-a161-31f18dfe339c","html_url":"https://github.com/redox-os/relibc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/redox-os/relibc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frelibc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frelibc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frelibc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frelibc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/redox-os","download_url":"https://codeload.github.com/redox-os/relibc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/redox-os%2Frelibc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261937039,"owners_count":23232846,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["libc","libredox","linux","posix","redox"],"created_at":"2024-08-01T17:01:17.418Z","updated_at":"2025-06-25T19:05:48.295Z","avatar_url":"https://github.com/redox-os.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Redox C Library (relibc)\n\nrelibc is a portable POSIX C standard library written in Rust and is under heavy development.\n\nThe motivation for this project is twofold: Reduce issues that the Redox developers were having with [newlib](https://sourceware.org/newlib/), and create a safer alternative to a C standard library written in C. It is mainly designed to be used under Redox, as an alternative to newlib, but it also supports Linux system calls via the [sc](https://crates.io/crates/sc) crate.\n\nCurrently Redox and Linux are supported.\n\n## redox-rt\n\nredox-rt is our equivalent for [vDSO](https://en.wikipedia.org/wiki/VDSO) from Linux.\n\n## Repository Layout\n\n- `include` - Header files (mostly macros and variadic functions `cbindgen` can't generate)\n- `src` - Source files\n- `src/c` - C code\n- `src/crt0` - Runtime code\n- `src/crti` - Runtime code\n- `src/crtn` - Runtime code\n- `src/header` - Header files implementation\n- `src/header/*` - Each folder has a `cbindgen.toml` file, it generates a C-to-Rust interface and header files\n- `src/ld_so` - Dynamic loader code\n- `src/platform` - Platform-specific and common code\n- `src/platform/redox` - Redox-specific code\n- `src/platform/linux` - Linux-specific code\n- `src/pthread` - pthread implementation\n- `src/sync` - Synchronization primitives\n- `tests` - C tests (each MR needs to give success in all of them)\n\n## Download the sources\n\nTo download the relibc sources run the following command:\n\n```sh\ngit clone --recursive https://gitlab.redox-os.org/redox-os/relibc\n```\n\n## Build Instructions\n\nTo build relibc out of the Redox build system, do the following steps:\n\n### Dependencies\n\n- Install `cbindgen`\n\n```sh\ncargo install cbindgen\n```\n\n#### Install the `expect` tool\n\n- Debian, Ubuntu and PopOS:\n\n```sh\nsudo apt install expect\n```\n\n- Fedora:\n\n```sh\nsudo dnf install expect\n```\n\n- Arch Linux:\n\n```sh\nsudo pacman -S expect\n```\n\n### Build Relibc\n\nTo build the relibc library objects, run the following command:\n\n```sh\nmake all\n```\n\n- Clean old library objects and tests\n\n```sh\nmake clean\n```\n\n## Build relibc inside the Redox build system\n\nInside of your Redox build system, run:\n\n```sh\nmake prefix\n```\n\nIf you need to rebuild `relibc` for testing a Cookbook recipe, run:\n\n```sh\ntouch relibc\nmake prefix r.recipe-name\n```\n\nTouching (changing the \"last modified time\" of) the `relibc` folder is needed to trigger recompilation for `make prefix`. Replace `recipe-name` with your desired recipe name.\n\nNote: Do not edit `relibc` inside `prefix` folder! Do your work on `relibc` folder directly inside your Redox build system instead.\n\n## Tests\n\nThis section explain how to build and run the tests.\n\n### Build\n\nTo build the tests run `make all` on the `tests` folder, it will store the executables at `tests/bins_static`\n\nIf you did changes to your tests, run `make clean all` to rebuild the executables.\n\n### Redox OS Testing\n\nTo test on Redox do the following steps:\n\n- Add the `relibc-tests` recipe on your filesystem configuration at `config/your-cpu/your-config.toml` (generally `desktop.toml`)\n- Run the following commands to rebuild relibc with your changes, update the `relibc-tests` recipe and update your QEMU image:\n\n```sh\ntouch relibc\n```\n\n```sh\nmake prefix cr.relibc-tests image\n```\n\n- Run the tests\n\n```sh\n/usr/share/relibc-tests/bins_static/test-name\n```\n\n### Linux Testing\n\nRun `make test` on the relibc directory.\n\nIf you want to run one test, run the following command:\n\n```sh\ntests/bins_static/test-name\n```\n\n## Issues\n\n#### I'm building for my own platform which I run, and am getting `x86_64-linux-gnu-ar: command not found` (or similar)\n\nThe Makefile expects GNU compiler tools prefixed with the platform specifier, as would be present when you installed a cross compiler. Since you are building for your own platform, some Linux distributions (like Manjaro) don't install/symlink the prefixed executables.\n\nAn easy fix would be to replace the corresponding lines in the Makefile, e.g.\n\n```diff\n ifeq ($(TARGET),x86_64-unknown-linux-gnu)\n        export CC=x86_64-linux-gnu-gcc\n-       export LD=x86_64-linux-gnu-ld\n-       export AR=x86_64-linux-gnu-ar\n+       export LD=ld\n+       export AR=ar\n        export OBJCOPY=x86_64-linux-gnu-objcopy\n endif\n```\n\n## Contributing\n\nBefore starting to contribute, read [this](CONTRIBUTING.md) document.\n\n## Supported OSes\n\n- Redox OS\n- Linux\n\n## Supported architectures\n\n- i686 (Intel/AMD)\n- x86_64 (Intel/AMD)\n- Aarch64 (ARM64)\n\n## Funding - _Unix-style Signals and Process Management_\n\nThis project is funded through [NGI Zero Core](https://nlnet.nl/core), a fund established by [NLnet](https://nlnet.nl) with financial support from the European Commission's [Next Generation Internet](https://ngi.eu) program. Learn more at the [NLnet project page](https://nlnet.nl/project/RedoxOS-Signals).\n\n[\u003cimg src=\"https://nlnet.nl/logo/banner.png\" alt=\"NLnet foundation logo\" width=\"20%\" /\u003e](https://nlnet.nl)\n[\u003cimg src=\"https://nlnet.nl/image/logos/NGI0_tag.svg\" alt=\"NGI Zero Logo\" width=\"20%\" /\u003e](https://nlnet.nl/core)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredox-os%2Frelibc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fredox-os%2Frelibc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fredox-os%2Frelibc/lists"}