Relocations are working
This commit is contained in:
10
justfile
10
justfile
@@ -12,11 +12,11 @@ sync_filesystem:
|
||||
sync
|
||||
|
||||
build_user_prog prog:
|
||||
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld" cargo b {{ cargo_flags }} --package {{ prog }}
|
||||
# cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||
riscv64-elf-objcopy -O binary {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie" cargo b {{ cargo_flags }} --package {{ prog }}
|
||||
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||
# riscv64-elf-objcopy -O binary {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||
|
||||
build: mount_filesystem (map_dir "user" "build_user_prog")
|
||||
build: mount_filesystem (map_dir "user" f"just cargo_flags=\"{{cargo_flags}}\" build_user_prog")
|
||||
cargo b {{ cargo_flags }}
|
||||
just sync_filesystem
|
||||
|
||||
@@ -25,7 +25,7 @@ run: build
|
||||
|
||||
map_dir dir recipe:
|
||||
@for file in `ls {{ dir }}`; do \
|
||||
just cargo_flags="{{ cargo_flags }}" {{ recipe }} $file ; \
|
||||
{{ recipe }} $file ; \
|
||||
done
|
||||
|
||||
qemu := "qemu-system-riscv64 -machine virt -device bochs-display -bios none -m 512M -device loader,file=disk.img,addr=0x90000000"
|
||||
|
||||
Reference in New Issue
Block a user