Add more from the std

This commit is contained in:
2026-03-20 10:45:54 +01:00
parent a134536d2f
commit 387e586086
6 changed files with 7 additions and 41 deletions

View File

@@ -1,7 +1,6 @@
release := ""
qemu_flags := ""
cargo_flags := "" + if release != "" { "--release" } else { "" }
KERNEL_FLAGS := "-Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem"
bin_path := if release != "" { "target/riscv64/release" } else { "target/riscv64/debug" }
default: run
@@ -20,12 +19,12 @@ build-sysroot:
@cd library/std && just build-sysroot
build_user_prog prog:
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }} --package {{ prog }}
RUSTFLAGS="-C relocation-model=pic -C link-arg=-pie --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }} --package {{ prog }}
riscv64-elf-strip {{ bin_path / prog }}
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
build: mount_filesystem (map_dir "user" f"just release=\"{{release}}\" cargo_flags=\"{{cargo_flags}}\" build_user_prog")
cargo b {{ cargo_flags }} {{ KERNEL_FLAGS }}
RUSTFLAGS="-Clink-arg=-Tilm.ld --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }}
just sync_filesystem
run: build (runner f"{{bin_path / "kernel-rust"}}")