xref: /relibc/README.md (revision 7016e5c833af9fe4182462e6a86e498cd5e8c738)
1bb376ff3SPaul# relibc ![build](https://travis-ci.org/redox-os/relibc.svg?branch=master)
2*39989b48Slongjinrelibc is a portable POSIX C standard library written in Rust. It is under heavy development, and currently supports Redox, Linux and DragonOS.
3d7aa9c44SMggMuggins
4d7aa9c44SMggMugginsThe motivation for this project is twofold: Reduce issues the redox crew was having with 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 syscalls via the [sc](https://crates.io/crates/sc) crate.
5d7aa9c44SMggMuggins
659cbc5beSFlorian Meißner## Building
759cbc5beSFlorian MeißnerJust run `make all`.
859cbc5beSFlorian Meißner
9*39989b48Slongjin### Build for DragonOS
10*39989b48Slongjin
11*39989b48SlongjinYou can follow the instructions to build relibc for DragonOS:
12*39989b48Slongjin
13*39989b48Slongjin```bash
14*39989b48Slongjinmkdir -p sysroot/usr
15*39989b48Slongjinmake -j $(nproc) && DESTDIR=sysroot/usr make install -j $(nproc)
16*39989b48Slongjin```
17*39989b48Slongjin
1859cbc5beSFlorian Meißner### Issues
1959cbc5beSFlorian Meißner#### I'm building for my own platform which I run, and am getting `x86_64-linux-gnu-ar: command not found` (or similar)
2059cbc5beSFlorian MeißnerThe Makefile expects the gnu compiler tools prefixed with the platform specifier, as would be present when you'd install a cross compiler. Since you are building for your own platform, some distros (like Manjaro) don't install/symlink the prefixed executables.
2159cbc5beSFlorian MeißnerAn easy fix would be to replace the corresponding lines in the Makefile, e.g.
2259cbc5beSFlorian Meißner```diff
2359cbc5beSFlorian Meißner ifeq ($(TARGET),x86_64-unknown-linux-gnu)
2459cbc5beSFlorian Meißner        export CC=x86_64-linux-gnu-gcc
2559cbc5beSFlorian Meißner-       export LD=x86_64-linux-gnu-ld
2659cbc5beSFlorian Meißner-       export AR=x86_64-linux-gnu-ar
2759cbc5beSFlorian Meißner+       export LD=ld
2859cbc5beSFlorian Meißner+       export AR=ar
2959cbc5beSFlorian Meißner        export OBJCOPY=x86_64-linux-gnu-objcopy
3059cbc5beSFlorian Meißner endif
3159cbc5beSFlorian Meißner```
3259cbc5beSFlorian Meißner
3392e1127bSTom Almeida### [Contributing](CONTRIBUTING.md)
3406a6922cSMggMuggins
35c2ae141dSDan Robertson## Supported OSes
36c2ae141dSDan Robertson
37c2ae141dSDan Robertson - Redox OS
38c2ae141dSDan Robertson - Linux
39*39989b48Slongjin - DragonOS
40c2ae141dSDan Robertson
41c2ae141dSDan Robertson## Supported architectures
42c2ae141dSDan Robertson
43c2ae141dSDan Robertson - x86\_64
44c2ae141dSDan Robertson - Aarch64
45