Add more from the std
This commit is contained in:
5
justfile
5
justfile
@@ -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"}}")
|
||||
|
||||
Reference in New Issue
Block a user