为DragonOS移植了的relibc

longjin 75d66c5566 remove malloc.c hai 1 ano
.cargo ed19381547 target=x86_64-dragonos能通过编译 hai 1 ano
.vscode bfe7a7f316 malloc with error hai 1 ano
core_io 9eeb73319d Update core_io submodule to a valid commit. %!s(int64=3) %!d(string=hai) anos
include 0646140d99 Remove detailed abort, too many compatibility issues hai 1 ano
openlibm b3dda7519d Update openlibm %!s(int64=5) %!d(string=hai) anos
posix-regex 0684fb6e4c Bump posix-regex version %!s(int64=6) %!d(string=hai) anos
pthreads-emb 9c423abb5f Update pthreads-emb %!s(int64=3) %!d(string=hai) anos
ralloc 6c11a18240 Go back to patched ralloc %!s(int64=6) %!d(string=hai) anos
src 75d66c5566 remove malloc.c hai 1 ano
tests ec6243bc5b wctrans/towctrans implementation proposal. hai 1 ano
.editorconfig 6952a079ae Fix CI %!s(int64=4) %!d(string=hai) anos
.gitignore a7480ea656 Fix global symbols relocations %!s(int64=3) %!d(string=hai) anos
.gitlab-ci.yml 9a7dfc4f4d Disable test:redox for now hai 1 ano
.gitmodules 2186cd1fbd Implement fexec in userspace. %!s(int64=2) %!d(string=hai) anos
CONTRIBUTING.md ff874c87d7 tests: Fix function signatures %!s(int64=5) %!d(string=hai) anos
Cargo.lock 691200021c Add sys_dup and sys_dup2 support (#2) hai 1 ano
Cargo.toml 691200021c Add sys_dup and sys_dup2 support (#2) hai 1 ano
LICENSE ba515d83df Create LICENSE %!s(int64=6) %!d(string=hai) anos
Makefile 39989b488c 适配dragonos hai 1 ano
README.md 39989b488c 适配dragonos hai 1 ano
Xargo.toml ae34ade595 Use path to patch compiler-builtins %!s(int64=4) %!d(string=hai) anos
bindgen_transform.sh 799c8828c2 mkdir and rmdir %!s(int64=6) %!d(string=hai) anos
build.rs e159490fc6 为dragonos进行配置(目前内存分配器无法创建memspace hai 1 ano
ci.sh 9f86748a58 Fix make libs in CI %!s(int64=4) %!d(string=hai) anos
fmt.sh bab4e2896a Format %!s(int64=6) %!d(string=hai) anos
init_dragonos_toolchain.sh bfe7a7f316 malloc with error hai 1 ano
redoxer.sh 903393574e redoxer.sh will clear build-std from CARGOFLAGS hai 1 ano
renamesyms.sh 70a8fca3c1 Use target binutils for renamesyms %!s(int64=2) %!d(string=hai) anos
rust-toolchain.toml 0bd476d28a Update to new Rust toolchain hai 1 ano
rustfmt.toml b8c50c7c64 Format %!s(int64=5) %!d(string=hai) anos

README.md

relibc build

relibc is a portable POSIX C standard library written in Rust. It is under heavy development, and currently supports Redox, Linux and DragonOS.

The 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 crate.

Building

Just run make all.

Build for DragonOS

You can follow the instructions to build relibc for DragonOS:

mkdir -p sysroot/usr
make -j $(nproc) && DESTDIR=sysroot/usr make install -j $(nproc)

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 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. 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

Supported OSes

  • Redox OS
  • Linux
  • DragonOS

Supported architectures

  • x86_64
  • Aarch64