为DragonOS移植了的relibc

GnoCiYeH 931a8760c4 Merge branch 'dragonos-relibc' into update-dsc преди 1 година
.cargo ed19381547 target=x86_64-dragonos能通过编译 преди 1 година
.vscode fd22fbbabf 添加了pipe的系统调用 (#14) преди 1 година
core_io 9eeb73319d Update core_io submodule to a valid commit. преди 3 години
include 0646140d99 Remove detailed abort, too many compatibility issues преди 1 година
openlibm b3dda7519d Update openlibm преди 5 години
posix-regex 0684fb6e4c Bump posix-regex version преди 6 години
pthreads-emb 9c423abb5f Update pthreads-emb преди 3 години
ralloc 6c11a18240 Go back to patched ralloc преди 6 години
src 0a1b6ce239 修改了一段 sigrestorer 汇编使得 dragonos 能正常执行 sigreturn (#20) преди 1 година
tests ec6243bc5b wctrans/towctrans implementation proposal. преди 1 година
.editorconfig 6952a079ae Fix CI преди 4 години
.gitignore 4f4c6e665f 增加对mmap、munmap、mprotect的支持 (#15) преди 1 година
.gitlab-ci.yml 9a7dfc4f4d Disable test:redox for now преди 1 година
.gitmodules 089ee030a1 更换submodule远程为dragonos镜像 (#16) преди 1 година
CONTRIBUTING.md ff874c87d7 tests: Fix function signatures преди 5 години
Cargo.toml 2c0c7f7bed update dsc преди 1 година
LICENSE ba515d83df Create LICENSE преди 6 години
Makefile 5e1004a8a8 编译的时候,如果系统已经安装x86_64-dragonos-gcc,则使用x86_64-dragonos-gcc来编译 (#10) преди 1 година
README.md 39989b488c 适配dragonos преди 1 година
Xargo.toml ae34ade595 Use path to patch compiler-builtins преди 4 години
bindgen_transform.sh 799c8828c2 mkdir and rmdir преди 6 години
build.rs be35961d82 Patch support run first demo on dragonos (#6) преди 1 година
ci.sh 9f86748a58 Fix make libs in CI преди 4 години
fmt.sh bab4e2896a Format преди 6 години
init_dragonos_toolchain.sh 70e3f729c5 完善初始化工具链脚本,增加对“已存在工具链配置文件“情况的判断 (#9) преди 1 година
redoxer.sh 903393574e redoxer.sh will clear build-std from CARGOFLAGS преди 1 година
renamesyms.sh 70a8fca3c1 Use target binutils for renamesyms преди 2 години
rust-toolchain.toml 0bd476d28a Update to new Rust toolchain преди 1 година
rustfmt.toml b8c50c7c64 Format преди 5 години

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