Cleans library directory

This commit is contained in:
2026-03-20 11:22:09 +01:00
parent 46cdc3714e
commit 8012b9e774
7 changed files with 22 additions and 272 deletions

View File

@@ -31,6 +31,9 @@ real_cp_std path:
@cp {{ RUST_SRC / "std/src" / path }} {{ "std/src" / path }}
setup-std:
ln -fs {{ RUST_SRC / "Cargo.toml" }} "."
ln -fs {{ RUST_SRC / "backtrace" }} "."
ln -fs {{ RUST_SRC / "std_detect" }} "."
ln -fs {{ RUST_SRC / "panic_abort" }} "."
ln -fs {{ RUST_SRC / "panic_unwind" }} "."
@@ -47,10 +50,15 @@ setup-std:
ln -fs {{ RUST_SRC / "proc_macro" }} "."
ln -fs {{ RUST_SRC / "profiler_builtins" }} "."
ln -fs {{ RUST_SRC / "test" }} "."
ln -fs {{ RUST_SRC / "coretests" }} "."
ln -fs {{ RUST_SRC / "alloctests" }} "."
ln -fs {{ RUST_SRC / "sysroot" }} "."
@just cp_std "../build.rs"
@sed -i "59a\ || target_os == \"survos\"" std/build.rs
@just cp_std "../Cargo.toml"
@just cp_std "alloc.rs"
@just cp_std "ascii.rs"
@just cp_std "backtrace.rs"
@@ -302,14 +310,15 @@ sys/exit.rs \
sys/mod.rs \
thread"
build-sysroot: update-std
RUSTFLAGS="-Zforce-unstable-if-unmarked -C relocation-model=pic -C link-arg=-pie" cargo build --target ../riscv64.json
build-sysroot:
RUSTFLAGS="-Zforce-unstable-if-unmarked -C relocation-model=pic -C link-arg=-pie" cargo build --package std --target ../riscv64.json \
--features compiler-builtins-mem
mkdir ../sysroot/lib/rustlib/riscv64/lib -p
rm ../sysroot/lib/rustlib/riscv64/lib/* -rf
cp target/riscv64/debug/deps/*.rlib ../sysroot/lib/rustlib/riscv64/lib
clean:
# cargo clean
cargo clean
rm ../sysroot/lib/rustlib/riscv64/lib/* -rf
for file in {{ STD_FILES }}; do \
@@ -317,3 +326,5 @@ clean:
done
rm -rf std/build.rs
rm -rf std/Cargo.toml
rm -rf Cargo.toml