oscourse-tsinghua / rcore_plus

Rust version of THU uCore OS. Linux compatible.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to build a customized std?

chyyuu opened this issue · comments

I only found https://github.com/Thinkofname/xargo

But I don't know how to modify std (no syscall, just function call) and add a mini std based app directly into kernel?

@wangrunji0408

How do I build the Rust standard library with a custom musl? looks like a reference.
But I don't know how to do it.

Build with customized std

Both xargo and cargo-xbuild support building with a customized std.

As their README saying:

# The source of the `core` crate must be in `$XARGO_RUST_SRC/libcore`
export XARGO_RUST_SRC=/path/to/rust/src
cargo xbuild  # or: xargo build

But I tried and met some problems.

Modify std

It seems that we can just create a new implementation at libstd/sys.
And I will try it later.