elaborate/update json in blog
This commit is contained in:
parent
cffad21a64
commit
ba089a5169
|
|
@ -117,24 +117,25 @@ As is, attempting to build this code will throw linker errors, because cargo wil
|
|||
"disable-redzone": true,
|
||||
"target-endian": "little",
|
||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
||||
"linker": "mold",
|
||||
"linker-flavor": "gnu",
|
||||
"linker": "rust-lld",
|
||||
"linker-flavor": "ld.lld",
|
||||
"llvm-target": "x86_64-unknown-none-elf",
|
||||
"max-atomic-width": 64,
|
||||
"panic-strategy": "abort",
|
||||
"plt-by-default": false,
|
||||
"position-independent-executables": true,
|
||||
"os": "none",
|
||||
"executables": true,
|
||||
"relro-level": "full",
|
||||
"rustc-abi": "softfloat",
|
||||
"stack-probes": {
|
||||
"kind": "inline"
|
||||
},
|
||||
"static-position-independent-executables": true,
|
||||
"supported-sanitizers": [
|
||||
"kcfi",
|
||||
"kernel-address"
|
||||
],
|
||||
"target-pointer-width": 64
|
||||
"target-pointer-width": 64,
|
||||
"target-c-int-width": 32
|
||||
}
|
||||
#+end_src
|
||||
|
||||
|
|
@ -148,6 +149,8 @@ More options available in the current rustc can be found by running the followin
|
|||
rustc -Zunstable-options --print target-spec-json-schema
|
||||
#+end_src
|
||||
|
||||
Notably, I have not copied the =*position-independent-executables= fields from the =x86_64-unknown-none-elf= target, because we will later use a linker script to place our kernel in the higher-half of the address space and modify the layout of our sections manually, and position independent executables complicate this.
|
||||
|
||||
If we now attempt to build our kernel, cargo will now complain that it cannot find the =core= crate since it is not available for our custom target:
|
||||
#+begin_src bash
|
||||
cargo -Zjson-target-spec build --target x86_64-unknown-kernel.json
|
||||
|
|
|
|||
Loading…
Reference in a new issue