]> git.lizzy.rs Git - loadnothing.git/commitdiff
Define linker memory origin flags in the target .json
authorHimbeerserverDE <himbeerserverde@gmail.com>
Fri, 16 Sep 2022 18:28:03 +0000 (20:28 +0200)
committerHimbeerserverDE <himbeerserverde@gmail.com>
Fri, 16 Sep 2022 18:28:03 +0000 (20:28 +0200)
Makefile
stage2/x86-loadnothing.json

index ec74fc8bbcb1e3093dfec27aa9c15a6290faaef7..4e7ca340ea9fe5f4815951a18ab7d0bec3981925 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ magic.bin:
        echo -en "\x55\xAA" > magic.bin
 
 stage2/target/x86-loadnothing/release/stage2: stage2/src/main.rs
-       cd stage2 && cargo rustc --release -- -C link-arg=-Ttext=0x7e00 -C link-arg=-Tdata=0x7e00 -C link-arg=--oformat=binary
+       cd stage2 && cargo build --release
 
 nothing.img: magic.bin stage2/target/x86-loadnothing/release/stage2 stage1/boot.bin
        dd if=/dev/zero of=nothing.img bs=32M count=1
index 556f46e0946f6cd1714b1e63c2872fd8cd7cf2cb..973ff9080aa36b2fc56572e6cff37aba1e9af373 100644 (file)
        "disable-redzone": true,
        "features": "-mmx,-sse,+soft-float",
        "cpu": "pentium",
-       "relocation-model": "static"
+       "relocation-model": "static",
+       "pre-link-args": {
+               "ld.lld": [
+                       "-Ttext=0x7e00",
+                       "-Tdata=0x7e00",
+                       "--oformat=binary"
+               ]
+       }
 }