redox-os/relibc là dự án mã nguồn mở trên GitHub với 1.0k sao, viết chủ yếu bằng Rust. Mirror of https://gitlab.redox-os.org/redox-os/relibc
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
relibc is a portable C standard library written in Rust and is under heavy development, this library contains the following items:
C, Linux, BSD functions and extensions
POSIX compatibility layer
Interfaces for system components
The motivation for this project is twofold: Reduce issues that the Redox developers were having with newlib, and create a more stable and safe alternative to C standard libraries written in C. It is mainly designed to be used under Redox, as an alternative to newlib, but it also supports Linux via the sc crate.
Currently Redox and Linux are supported.
redox-rt
redox-rt is a runtime library that provides much of the code that enables POSIX on Redox, like fork, exec, signal handling, etc.
Relibc uses it as backend in src/platform/redox, and it's intended to eventually be usable independently, without relibc.
Repository Layout
include - Header files (mostly macros and variadic functions cbindgen can't generate)
src - Source files
src/c - C code
src/crt0 - Runtime code
src/crti - Runtime code
src/crtn - Runtime code
src/header - Header files implementation
src/header/* - Each folder has a cbindgen.toml file, it generates a C-to-Rust interface and header files
src/ld_so - Dynamic loader code
src/platform - Platform-specific and common code
src/platform/redox - Redox-specific code
src/platform/linux - Linux-specific code
src/pthread - pthread implementation
src/sync - Synchronization primitives
tests - C tests (each MR needs to give success in all of them)
Download the sources
To download the relibc sources run the following command:
To build relibc out of the Redox build system, do the following steps:
Dependencies
Install cbindgen
cargo install cbindgen
Install the expect tool
Debian, Ubuntu and PopOS:
sudo apt install expect
Fedora:
sudo dnf install expect
Arch Linux:
sudo pacman -S expect
Void Linux:
sudo xbps-install -S expect
Build Relibc
To build the relibc library objects, run the following command:
make all
Clean old library objects and tests
make clean
Build relibc inside the Redox build system
Inside of your Redox build system, run:
make prefix
If you need to rebuild relibc for testing a Cookbook recipe, run:
touch relibc
make prefix r.recipe-name
Touching (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.
Note: Do not edit relibc inside prefix folder! Do your work on relibc folder directly inside your Redox build system instead.
Tests
Relibc has a test suite that also runs every time a new commit get pushed. You can see .gitlab-ci.yml to see how it's being executed. That being said, ./check.sh is the recommended way to run tests. Here's few examples:
./check.sh - Run build, without running the test
./check.sh --test - Run all tests in x86_64 Redox using Redoxer
./check.sh --test --host - Run all tests in host (Linux)
./check.sh --test --arch=aarch64 - Run all tests in specified arch
Arch can be x86_64, aarch64, i586, or riscv64gc
./check.sh --test=stdio/printf - Run a single test
Can be combined with --host or --arch
Will run statically linked test in Linux, dynamically linked in Redox
Couple of notes:
Relibc and its tests will rebuild if files are changed, however switching between arch or host requires you to run make clean
Redoxer is needed to run tests for Redox without --host. You can install it using cargo install redoxer
Tests can hang, the test runner can anticipate this, assuming the kernel doesn't hang too.
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 config.mk, e.g.
Before starting to contribute, read this document.
Supported OSes
Redox OS
Linux
Supported architectures
i586 (Intel/AMD)
x86_64 (Intel/AMD)
aarch64 (ARM64)
riscv64gc (RISC-V)
Funding - Unix-style Signals and Process Management
This project is funded through NGI Zero Core, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/redox-os/relibc là nguồn chính thức.
redox-os/relibc có bao nhiêu sao?
redox-os/relibc có 1.0k sao GitHub — tải lại trang để xem số mới nhất, hoặc xem trực tiếp github.com/redox-os/relibc. TopGit phản chiếu số sao của GitHub nhưng không cam kết đến từng phút.
redox-os/relibc có những chủ đề gì?
GitHub topics của redox-os/relibc: "libc", "libredox", "linux", "posix", "redox". TopGit xếp repo vào nhóm mã nguồn mở.
redox-os/relibc còn đang phát triển không?
Commit gần nhất trên redox-os/relibc là 4 ngày trước (theo timestamp GitHub). Repo có 74 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
redox-os/relibc viết bằng ngôn ngữ gì?
redox-os/relibc chủ yếu viết bằng Rust. Trường "language" của GitHub dựa trên phần lớn byte ở nhánh mặc định.
Đọc đầy đủ README ở tab phía trên.
relibc có đáng để bạn bỏ thời gian?
ChatGPT, Claude và Perplexity đều đọc được trang này. Hỏi thử xem họ nghĩ gì về relibc.