From 41c88ed28859b4cbfb7e1037b454704d34ba92ac Mon Sep 17 00:00:00 2001 From: Ribbon Date: Thu, 19 Dec 2024 02:41:40 +0000 Subject: [PATCH] Document the build instructions and improve the README --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 952f13455c..68bff0533e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,11 @@ # Redox C Library (relibc) -relibc is a portable POSIX C standard library written in Rust. It is under heavy development, and currently supports Redox and Linux. +relibc is a portable POSIX C standard library written in Rust and is under heavy development. The 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. +Currently Redox and Linux are supported. + ## redox-rt redox-rt is our equivalent for [vDSO](https://en.wikipedia.org/wiki/VDSO) from Linux. @@ -26,7 +28,61 @@ redox-rt is our equivalent for [vDSO](https://en.wikipedia.org/wiki/VDSO) from L - `src/sync` - Synchronization primitives - `tests` - C tests (each MR needs to give success in all of them) -## Build On The Build System +## Download the sources + +To download the relibc sources run the following command: + +```sh +git clone --recursive https://gitlab.redox-os.org/redox-os/relibc +``` + +## Build Instructions + +To build relibc out of the Redox build system, do the following steps: + +### Dependencies + +- Install `cbindgen` + +```sh +cargo install cbindgen +``` + +#### Install the `expect` tool + +- Debian, Ubuntu and PopOS: + +```sh +sudo apt install expect +``` + +- Fedora: + +```sh +sudo dnf install expect +``` + +- Arch Linux: + +```sh +sudo pacman -S expect +``` + +### Build Relibc + +To build the relibc library objects, run the following command: + +```sh +make all +``` + +- Clean old library objects and tests + +```sh +make clean +``` + +## Build relibc inside the Redox build system Inside of your Redox build system, run: