how to build a customized std?
chyyuu opened this issue · comments
chyyuu commented
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?
chyyuu commented
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.
Runji Wang commented
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.
Runji Wang commented
I figured it out. See the wiki page:
How to build std Rust programs with customized musl libc.