]> git.lizzy.rs Git - loadnothing.git/commitdiff
Rust: produce executable in binary format (was ELF before)
authorHimbeerserverDE <himbeerserverde@gmail.com>
Tue, 13 Sep 2022 19:04:00 +0000 (21:04 +0200)
committerHimbeerserverDE <himbeerserverde@gmail.com>
Tue, 13 Sep 2022 19:04:00 +0000 (21:04 +0200)
Makefile

index 91b0bff7b6cb28bde41bd00f674e0d19625b5a7a..1cd8e25f3ab8db59dbddcf235f89608b444965db 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,9 @@ magic.bin:
        echo -en "\x55\xAA" > magic.bin
 
 stage2/target/x86_64-loadnothing/release/stage2: stage2/src/main.rs
-       cd stage2 && cargo build --release
+       cd stage2 && cargo rustc --release -- --emit=obj
+       ld -o stage2/target/x86_64-loadnothing/release/stage2.bin --oformat binary stage2/target/x86_64-loadnothing/release/stage2 -Ttext=0x7e00
+       mv stage2/target/x86_64-loadnothing/release/stage2.bin stage2/target/x86_64-loadnothing/release/stage2
 
 nothing.img: magic.bin stage2/target/x86_64-loadnothing/release/stage2 stage1/boot.bin
        dd if=/dev/zero of=nothing.img bs=32M count=1