Browse Source

适配dragonos

longjin 1 năm trước cách đây
mục cha
commit
39989b488c
4 tập tin đã thay đổi với 17 bổ sung4 xóa
  1. 1 0
      Cargo.lock
  2. 3 1
      Cargo.toml
  3. 2 2
      Makefile
  4. 11 1
      README.md

+ 1 - 0
Cargo.lock

@@ -111,6 +111,7 @@ version = "0.1.0"
 [[package]]
 name = "dsc"
 version = "0.1.0"
+source = "git+https://github.com/DragonOS-Community/dsc.git?rev=f073773#f073773275e0969be41a3de68d4cf2aa8773ad05"
 
 [[package]]
 name = "errno"

+ 3 - 1
Cargo.toml

@@ -41,7 +41,9 @@ optional = true
 sc = "0.2.3"
 
 [target.'cfg(target_os = "dragonos")'.dependencies]
-dsc = { path = "/home/longjin/code/dragonos-syscall" }
+# Development
+#dsc = { path = "本地存放dsc的代码的路径" }
+dsc = { git = "https://github.com/DragonOS-Community/dsc.git", rev = "f073773" }
 
 [target.'cfg(target_os = "redox")'.dependencies]
 redox_syscall = "0.3"

+ 2 - 2
Makefile

@@ -47,9 +47,9 @@ ifeq ($(TARGET),x86_64-unknown-redox)
 endif
 
 ifeq ($(TARGET),x86_64-unknown-dragonos)
-	export CC=x86_64-dragonos-gcc
+	export CC=gcc
 # export LD=ld
-	export LD=x86_64-dragonos-ld
+	export LD=ld
 	export AR=ar
 # export AR=x86_64-dragonos-ar
 	export OBJCOPY=objcopy

+ 11 - 1
README.md

@@ -1,11 +1,20 @@
 # relibc ![build](https://travis-ci.org/redox-os/relibc.svg?branch=master)
-relibc is a portable POSIX C standard library written in Rust. It is under heavy development, and currently supports Redox and Linux.
+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](https://crates.io/crates/sc) crate.
 
 ## Building
 Just run `make all`.
 
+### Build for DragonOS
+
+You can follow the instructions to build relibc for DragonOS:
+
+```bash
+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.
@@ -27,6 +36,7 @@ An easy fix would be to replace the corresponding lines in the Makefile, e.g.
 
  - Redox OS
  - Linux
+ - DragonOS
 
 ## Supported architectures