1 unstable release
0.1.0 | Mar 3, 2018 |
---|
#887 in Unix APIs
811 stars & 35 watchers
1MB
30K
SLoC
relibc
relibc is a portable POSIX C standard library written in Rust. It is under heavy development, and currently supports Redox and Linux.
The motivation for this project is twofold: Reduce issues that the Redox developers were 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 system calls via the sc crate.
Repository Layout
include
- Header files (mostly macros and variadic functionscbindgen
can't generate)src
- Source filessrc/c
- C codesrc/crt0
- Runtime codesrc/crti
- Runtime codesrc/crtn
- Runtime codesrc/header
- Header files implementationsrc/header/*
- Each folder has acbindgen.toml
file, it generates a C-to-Rust interface and header filessrc/ld_so
- Dynamic loader codesrc/platform
- Platform-specific and common codesrc/platform/redox
- Redox-specific codesrc/platform/linux
- Linux-specific codesrc/pthread
- pthread implementationsrc/sync
- Synchronization primitivestests
- C tests (each MR needs to give success in all of them)
Build On The Build System
Inside of your Redox build system, run:
make prefix
(It only works if the timestamp of the relibc
folder changed)
Issues
I'm building for my own platform which I run, and am getting x86_64-linux-gnu-ar: command not found
(or similar)
The 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.
An easy fix would be to replace the corresponding lines in the Makefile, e.g.
ifeq ($(TARGET),x86_64-unknown-linux-gnu)
export CC=x86_64-linux-gnu-gcc
- export LD=x86_64-linux-gnu-ld
- export AR=x86_64-linux-gnu-ar
+ export LD=ld
+ export AR=ar
export OBJCOPY=x86_64-linux-gnu-objcopy
endif
Contributing
Before starting to contribute, read this document.
Supported OSes
- Redox OS
- Linux
Supported architectures
- x86_64 (Intel/AMD)
- Aarch64 (ARM64)
Dependencies
~3.5MB
~64K SLoC