elaborate/update json in blog
This commit is contained in:
parent
cffad21a64
commit
ba089a5169
|
|
@ -109,32 +109,33 @@ As is, attempting to build this code will throw linker errors, because cargo wil
|
||||||
|
|
||||||
#+begin_src json
|
#+begin_src json
|
||||||
{
|
{
|
||||||
"arch": "x86_64",
|
"arch": "x86_64",
|
||||||
"code-model": "kernel",
|
"code-model": "kernel",
|
||||||
"cpu": "x86-64",
|
"cpu": "x86-64",
|
||||||
"crt-objects-fallback": "false",
|
"crt-objects-fallback": "false",
|
||||||
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
|
"data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128",
|
||||||
"disable-redzone": true,
|
"disable-redzone": true,
|
||||||
"target-endian": "little",
|
"target-endian": "little",
|
||||||
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
"features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float",
|
||||||
"linker": "mold",
|
"linker": "rust-lld",
|
||||||
"linker-flavor": "gnu",
|
"linker-flavor": "ld.lld",
|
||||||
"llvm-target": "x86_64-unknown-none-elf",
|
"llvm-target": "x86_64-unknown-none-elf",
|
||||||
"max-atomic-width": 64,
|
"max-atomic-width": 64,
|
||||||
"panic-strategy": "abort",
|
"panic-strategy": "abort",
|
||||||
"plt-by-default": false,
|
"plt-by-default": false,
|
||||||
"position-independent-executables": true,
|
"os": "none",
|
||||||
"relro-level": "full",
|
"executables": true,
|
||||||
"rustc-abi": "softfloat",
|
"relro-level": "full",
|
||||||
"stack-probes": {
|
"rustc-abi": "softfloat",
|
||||||
"kind": "inline"
|
"stack-probes": {
|
||||||
},
|
"kind": "inline"
|
||||||
"static-position-independent-executables": true,
|
},
|
||||||
"supported-sanitizers": [
|
"supported-sanitizers": [
|
||||||
"kcfi",
|
"kcfi",
|
||||||
"kernel-address"
|
"kernel-address"
|
||||||
],
|
],
|
||||||
"target-pointer-width": 64
|
"target-pointer-width": 64,
|
||||||
|
"target-c-int-width": 32
|
||||||
}
|
}
|
||||||
#+end_src
|
#+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
|
rustc -Zunstable-options --print target-spec-json-schema
|
||||||
#+end_src
|
#+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:
|
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
|
#+begin_src bash
|
||||||
cargo -Zjson-target-spec build --target x86_64-unknown-kernel.json
|
cargo -Zjson-target-spec build --target x86_64-unknown-kernel.json
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue