diff --git a/crates/sel4-generate-target-specs/src/main.rs b/crates/sel4-generate-target-specs/src/main.rs index 4b419f558..50e32be67 100644 --- a/crates/sel4-generate-target-specs/src/main.rs +++ b/crates/sel4-generate-target-specs/src/main.rs @@ -14,7 +14,7 @@ use std::fs; use std::path::Path; use rustc_target::json::ToJson; -use rustc_target::spec::{Cc, CodeModel, LinkerFlavor, Lld, Target, TargetTriple}; +use rustc_target::spec::{Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, Target, TargetTriple}; use clap::{Arg, ArgAction, Command}; @@ -23,6 +23,7 @@ struct Config { arch: Arch, context: Context, minimal: bool, + unwind: bool, musl: bool, } @@ -107,7 +108,7 @@ impl Config { let options = &mut target.options; options.is_builtin = false; options.exe_suffix = ".elf".into(); - options.eh_frame_header = self.arch.unwinding_support() && !self.minimal; + options.eh_frame_header = self.unwinding_support(); } if let Context::Microkit { resettable } = &self.context { @@ -122,6 +123,10 @@ impl Config { target.options.has_thread_local = !self.minimal; + if self.unwinding_support() { + target.options.panic_strategy = PanicStrategy::Unwind; + } + if self.musl { let options = &mut target.options; options.os = "linux".into(); @@ -134,10 +139,17 @@ impl Config { target } + fn unwinding_support(&self) -> bool { + self.arch.unwinding_support() && self.unwind + } + fn filter(&self) -> bool { if self.context.is_microkit() && !self.arch.microkit_support() { return false; } + if self.unwinding_support() && self.minimal { + return false; + } if self.musl && (self.minimal || self.context.is_microkit()) { return false; } @@ -156,6 +168,9 @@ impl Config { if self.minimal { name.push_str("-minimal"); } + if self.unwind { + name.push_str("-unwind"); + } if self.musl { name.push_str("-musl"); } @@ -167,13 +182,16 @@ impl Config { for arch in Arch::all() { for context in Context::all() { for minimal in [true, false] { - for musl in [true, false] { - all.push(Self { - arch, - context, - minimal, - musl, - }); + for unwind in [true, false] { + for musl in [true, false] { + all.push(Self { + arch, + context, + minimal, + unwind, + musl, + }); + } } } } diff --git a/hacking/nix/scope/default.nix b/hacking/nix/scope/default.nix index 2984d0018..300d6f6c8 100644 --- a/hacking/nix/scope/default.nix +++ b/hacking/nix/scope/default.nix @@ -161,6 +161,7 @@ superCallPackage ../rust-utils {} self // { microkit ? false , resettable ? false , minimal ? false + , unwind ? false , musl ? false }: lib.concatStrings [ @@ -169,6 +170,7 @@ superCallPackage ../rust-utils {} self // (lib.optionalString microkit "-microkit") (lib.optionalString resettable "-resettable") (lib.optionalString minimal "-minimal") + (lib.optionalString unwind "-unwind") (lib.optionalString musl "-musl") ]; diff --git a/hacking/nix/scope/world/instances/default.nix b/hacking/nix/scope/world/instances/default.nix index 006b62277..1f5c59248 100644 --- a/hacking/nix/scope/world/instances/default.nix +++ b/hacking/nix/scope/world/instances/default.nix @@ -153,8 +153,8 @@ in rec { orig = mkTask { rootCrate = crates.tests-root-task-backtrace; release = false; + targetTriple = mkSeL4RustTargetTriple { unwind = true; }; extraProfile = { - panic = "unwind"; opt-level = 2; }; }; @@ -343,10 +343,8 @@ in rec { threads = maybe (haveFullRuntime && haveCapDLInitializer) (mkInstance rec { test = mkTask { rootCrate = crates.tests-capdl-threads-components-test; + targetTriple = mkSeL4RustTargetTriple { unwind = true; }; release = true; # test optimizations - extraProfile = { - panic = "unwind"; - }; }; rootTask = mkCapDLInitializer { small = false; @@ -367,10 +365,8 @@ in rec { utcover = maybe (haveFullRuntime && haveCapDLInitializer) (mkInstance rec { test = mkTask { rootCrate = crates.tests-capdl-utcover-components-test; + targetTriple = mkSeL4RustTargetTriple { unwind = true; }; release = false; - extraProfile = { - panic = "unwind"; - }; }; rootTask = mkCapDLInitializer { small = true; @@ -417,8 +413,8 @@ in rec { example-root-task-without-runtime = maybe haveMinimalRuntime (mkInstance { rootTask = mkTask { rootCrate = crates.example-root-task-without-runtime; - release = false; targetTriple = mkSeL4RustTargetTriple { minimal = true; }; + release = false; }; extraPlatformArgs = lib.optionalAttrs canSimulate { canAutomateSimply = true; diff --git a/support/targets/README.md b/support/targets/README.md index 0704b1f2b..27d2d1706 100644 --- a/support/targets/README.md +++ b/support/targets/README.md @@ -15,6 +15,9 @@ your Rust toolchain. The difference between the `*-minimal` targets and the non-minimal ones are that the minimal ones have `"has-thread-local": false`. +The difference between the `*-unwind` targets and the non-unwind ones are that the unwind ones have +`"panic = "unwind"`. + The difference between the `*-sel4-microkit` targets and the `*-sel4` ones is that the `*-sel4-microkit` targets include a linker script fragment to add the `__sel4_ipc_buffer_obj` symbol required by the `microkit` tool. diff --git a/support/targets/aarch64-sel4-microkit-resettable-unwind.json b/support/targets/aarch64-sel4-microkit-resettable-unwind.json new file mode 100644 index 000000000..35fed7bbc --- /dev/null +++ b/support/targets/aarch64-sel4-microkit-resettable-unwind.json @@ -0,0 +1,35 @@ +{ + "arch": "aarch64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", + "disable-redzone": true, + "exe-suffix": ".elf", + "features": "+v8a,+strict-align,+neon,+fp-armv8", + "has-thread-local": true, + "link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "aarch64-unknown-none", + "max-atomic-width": 128, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "pre-link-args": { + "gnu-lld": [ + "-z", + "max-page-size=4096" + ] + }, + "relocation-model": "static", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/aarch64-sel4-microkit-resettable.json b/support/targets/aarch64-sel4-microkit-resettable.json index 906284b21..2902c5617 100644 --- a/support/targets/aarch64-sel4-microkit-resettable.json +++ b/support/targets/aarch64-sel4-microkit-resettable.json @@ -3,6 +3,7 @@ "crt-objects-fallback": "false", "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", "disable-redzone": true, + "eh-frame-header": false, "exe-suffix": ".elf", "features": "+v8a,+strict-align,+neon,+fp-armv8", "has-thread-local": true, diff --git a/support/targets/aarch64-sel4-microkit-unwind.json b/support/targets/aarch64-sel4-microkit-unwind.json new file mode 100644 index 000000000..3f3692960 --- /dev/null +++ b/support/targets/aarch64-sel4-microkit-unwind.json @@ -0,0 +1,35 @@ +{ + "arch": "aarch64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", + "disable-redzone": true, + "exe-suffix": ".elf", + "features": "+v8a,+strict-align,+neon,+fp-armv8", + "has-thread-local": true, + "link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "aarch64-unknown-none", + "max-atomic-width": 128, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "pre-link-args": { + "gnu-lld": [ + "-z", + "max-page-size=4096" + ] + }, + "relocation-model": "static", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/aarch64-sel4-microkit.json b/support/targets/aarch64-sel4-microkit.json index 6e6c6246e..72bce14f6 100644 --- a/support/targets/aarch64-sel4-microkit.json +++ b/support/targets/aarch64-sel4-microkit.json @@ -3,6 +3,7 @@ "crt-objects-fallback": "false", "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", "disable-redzone": true, + "eh-frame-header": false, "exe-suffix": ".elf", "features": "+v8a,+strict-align,+neon,+fp-armv8", "has-thread-local": true, diff --git a/support/targets/aarch64-sel4-musl.json b/support/targets/aarch64-sel4-musl.json index c0d384190..d2a5011d9 100644 --- a/support/targets/aarch64-sel4-musl.json +++ b/support/targets/aarch64-sel4-musl.json @@ -5,6 +5,7 @@ "crt-static-respected": true, "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", "disable-redzone": true, + "eh-frame-header": false, "env": "musl", "exe-suffix": ".elf", "features": "+v8a,+strict-align,+neon,+fp-armv8", diff --git a/support/targets/aarch64-sel4-unwind-musl.json b/support/targets/aarch64-sel4-unwind-musl.json new file mode 100644 index 000000000..738367774 --- /dev/null +++ b/support/targets/aarch64-sel4-unwind-musl.json @@ -0,0 +1,41 @@ +{ + "arch": "aarch64", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", + "disable-redzone": true, + "env": "musl", + "exe-suffix": ".elf", + "features": "+v8a,+strict-align,+neon,+fp-armv8", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "aarch64-unknown-none", + "max-atomic-width": 128, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "pre-link-args": { + "gnu-lld": [ + "-z", + "max-page-size=4096" + ] + }, + "relocation-model": "static", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-family": [ + "unix" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/aarch64-sel4-unwind.json b/support/targets/aarch64-sel4-unwind.json new file mode 100644 index 000000000..90fa09198 --- /dev/null +++ b/support/targets/aarch64-sel4-unwind.json @@ -0,0 +1,34 @@ +{ + "arch": "aarch64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", + "disable-redzone": true, + "exe-suffix": ".elf", + "features": "+v8a,+strict-align,+neon,+fp-armv8", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "aarch64-unknown-none", + "max-atomic-width": 128, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "pre-link-args": { + "gnu-lld": [ + "-z", + "max-page-size=4096" + ] + }, + "relocation-model": "static", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/aarch64-sel4.json b/support/targets/aarch64-sel4.json index ddb515049..2d7212010 100644 --- a/support/targets/aarch64-sel4.json +++ b/support/targets/aarch64-sel4.json @@ -3,6 +3,7 @@ "crt-objects-fallback": "false", "data-layout": "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32", "disable-redzone": true, + "eh-frame-header": false, "exe-suffix": ".elf", "features": "+v8a,+strict-align,+neon,+fp-armv8", "has-thread-local": true, diff --git a/support/targets/armv7a-sel4-minimal-unwind.json b/support/targets/armv7a-sel4-minimal-unwind.json new file mode 100644 index 000000000..6817fa5ff --- /dev/null +++ b/support/targets/armv7a-sel4-minimal-unwind.json @@ -0,0 +1,25 @@ +{ + "abi": "eabi", + "arch": "arm", + "c-enum-min-bits": 8, + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", + "disable-redzone": true, + "eh-frame-header": false, + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+v7,+thumb2,+soft-float,-neon,+strict-align", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "armv7a-none-eabi", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "relocation-model": "static", + "target-pointer-width": "32" +} diff --git a/support/targets/armv7a-sel4-unwind-musl.json b/support/targets/armv7a-sel4-unwind-musl.json new file mode 100644 index 000000000..43e922774 --- /dev/null +++ b/support/targets/armv7a-sel4-unwind-musl.json @@ -0,0 +1,33 @@ +{ + "abi": "eabi", + "arch": "arm", + "c-enum-min-bits": 8, + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", + "disable-redzone": true, + "eh-frame-header": false, + "emit-debug-gdb-scripts": false, + "env": "musl", + "exe-suffix": ".elf", + "features": "+v7,+thumb2,+soft-float,-neon,+strict-align", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "armv7a-none-eabi", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "panic-strategy": "abort", + "relocation-model": "static", + "target-family": [ + "unix" + ], + "target-pointer-width": "32" +} diff --git a/support/targets/armv7a-sel4-unwind.json b/support/targets/armv7a-sel4-unwind.json new file mode 100644 index 000000000..6be0e87b2 --- /dev/null +++ b/support/targets/armv7a-sel4-unwind.json @@ -0,0 +1,26 @@ +{ + "abi": "eabi", + "arch": "arm", + "c-enum-min-bits": 8, + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:32:32-Fi8-i64:64-v128:64:128-a:0:32-n32-S64", + "disable-redzone": true, + "eh-frame-header": false, + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+v7,+thumb2,+soft-float,-neon,+strict-align", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "armv7a-none-eabi", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "panic-strategy": "abort", + "relocation-model": "static", + "target-pointer-width": "32" +} diff --git a/support/targets/riscv32imac-sel4-musl.json b/support/targets/riscv32imac-sel4-musl.json index 353d5048b..2e8797843 100644 --- a/support/targets/riscv32imac-sel4-musl.json +++ b/support/targets/riscv32imac-sel4-musl.json @@ -5,6 +5,7 @@ "crt-static-default": true, "crt-static-respected": true, "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "env": "musl", "exe-suffix": ".elf", diff --git a/support/targets/riscv32imac-sel4-unwind-musl.json b/support/targets/riscv32imac-sel4-unwind-musl.json new file mode 100644 index 000000000..f3ed96943 --- /dev/null +++ b/support/targets/riscv32imac-sel4-unwind-musl.json @@ -0,0 +1,30 @@ +{ + "arch": "riscv32", + "cpu": "generic-rv32", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "emit-debug-gdb-scripts": false, + "env": "musl", + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "ilp32", + "llvm-target": "riscv32", + "max-atomic-width": 32, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "relocation-model": "static", + "target-family": [ + "unix" + ], + "target-pointer-width": "32" +} diff --git a/support/targets/riscv32imac-sel4-unwind.json b/support/targets/riscv32imac-sel4-unwind.json new file mode 100644 index 000000000..5c5230661 --- /dev/null +++ b/support/targets/riscv32imac-sel4-unwind.json @@ -0,0 +1,23 @@ +{ + "arch": "riscv32", + "cpu": "generic-rv32", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "ilp32", + "llvm-target": "riscv32", + "max-atomic-width": 32, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "target-pointer-width": "32" +} diff --git a/support/targets/riscv32imac-sel4.json b/support/targets/riscv32imac-sel4.json index 686027d40..f6992b5c5 100644 --- a/support/targets/riscv32imac-sel4.json +++ b/support/targets/riscv32imac-sel4.json @@ -3,6 +3,7 @@ "cpu": "generic-rv32", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+c", diff --git a/support/targets/riscv32imafc-sel4-musl.json b/support/targets/riscv32imafc-sel4-musl.json index 5af4c1ab4..42a8fea5d 100644 --- a/support/targets/riscv32imafc-sel4-musl.json +++ b/support/targets/riscv32imafc-sel4-musl.json @@ -5,6 +5,7 @@ "crt-static-default": true, "crt-static-respected": true, "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "env": "musl", "exe-suffix": ".elf", diff --git a/support/targets/riscv32imafc-sel4-unwind-musl.json b/support/targets/riscv32imafc-sel4-unwind-musl.json new file mode 100644 index 000000000..cc0244aa1 --- /dev/null +++ b/support/targets/riscv32imafc-sel4-unwind-musl.json @@ -0,0 +1,30 @@ +{ + "arch": "riscv32", + "cpu": "generic-rv32", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "emit-debug-gdb-scripts": false, + "env": "musl", + "exe-suffix": ".elf", + "features": "+m,+a,+c,+f", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "ilp32f", + "llvm-target": "riscv32", + "max-atomic-width": 32, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "relocation-model": "static", + "target-family": [ + "unix" + ], + "target-pointer-width": "32" +} diff --git a/support/targets/riscv32imafc-sel4-unwind.json b/support/targets/riscv32imafc-sel4-unwind.json new file mode 100644 index 000000000..d3b476bae --- /dev/null +++ b/support/targets/riscv32imafc-sel4-unwind.json @@ -0,0 +1,23 @@ +{ + "arch": "riscv32", + "cpu": "generic-rv32", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+c,+f", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "ilp32f", + "llvm-target": "riscv32", + "max-atomic-width": 32, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "target-pointer-width": "32" +} diff --git a/support/targets/riscv32imafc-sel4.json b/support/targets/riscv32imafc-sel4.json index 1d5ef4d0b..8d3e42430 100644 --- a/support/targets/riscv32imafc-sel4.json +++ b/support/targets/riscv32imafc-sel4.json @@ -3,6 +3,7 @@ "cpu": "generic-rv32", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:32:32-i64:64-n32-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+c,+f", diff --git a/support/targets/riscv64gc-sel4-microkit-resettable-unwind.json b/support/targets/riscv64gc-sel4-microkit-resettable-unwind.json new file mode 100644 index 000000000..c195be2ac --- /dev/null +++ b/support/targets/riscv64gc-sel4-microkit-resettable-unwind.json @@ -0,0 +1,29 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+f,+d,+c", + "has-thread-local": true, + "link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64d", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64gc-sel4-microkit-resettable.json b/support/targets/riscv64gc-sel4-microkit-resettable.json index 557fd1372..94eac865e 100644 --- a/support/targets/riscv64gc-sel4-microkit-resettable.json +++ b/support/targets/riscv64gc-sel4-microkit-resettable.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+f,+d,+c", diff --git a/support/targets/riscv64gc-sel4-microkit-unwind.json b/support/targets/riscv64gc-sel4-microkit-unwind.json new file mode 100644 index 000000000..14ce2b578 --- /dev/null +++ b/support/targets/riscv64gc-sel4-microkit-unwind.json @@ -0,0 +1,29 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+f,+d,+c", + "has-thread-local": true, + "link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64d", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64gc-sel4-microkit.json b/support/targets/riscv64gc-sel4-microkit.json index aba45ed0a..517e3c069 100644 --- a/support/targets/riscv64gc-sel4-microkit.json +++ b/support/targets/riscv64gc-sel4-microkit.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+f,+d,+c", diff --git a/support/targets/riscv64gc-sel4-musl.json b/support/targets/riscv64gc-sel4-musl.json index fbb3ad62f..56441edc5 100644 --- a/support/targets/riscv64gc-sel4-musl.json +++ b/support/targets/riscv64gc-sel4-musl.json @@ -6,6 +6,7 @@ "crt-static-default": true, "crt-static-respected": true, "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "env": "musl", "exe-suffix": ".elf", diff --git a/support/targets/riscv64gc-sel4-unwind-musl.json b/support/targets/riscv64gc-sel4-unwind-musl.json new file mode 100644 index 000000000..78e533feb --- /dev/null +++ b/support/targets/riscv64gc-sel4-unwind-musl.json @@ -0,0 +1,35 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "env": "musl", + "exe-suffix": ".elf", + "features": "+m,+a,+f,+d,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64d", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-family": [ + "unix" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64gc-sel4-unwind.json b/support/targets/riscv64gc-sel4-unwind.json new file mode 100644 index 000000000..75c62c903 --- /dev/null +++ b/support/targets/riscv64gc-sel4-unwind.json @@ -0,0 +1,28 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+f,+d,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64d", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64gc-sel4.json b/support/targets/riscv64gc-sel4.json index 035af2531..7d4781bd7 100644 --- a/support/targets/riscv64gc-sel4.json +++ b/support/targets/riscv64gc-sel4.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+f,+d,+c", diff --git a/support/targets/riscv64imac-sel4-microkit-resettable-unwind.json b/support/targets/riscv64imac-sel4-microkit-resettable-unwind.json new file mode 100644 index 000000000..74a85aaee --- /dev/null +++ b/support/targets/riscv64imac-sel4-microkit-resettable-unwind.json @@ -0,0 +1,29 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "link-script": "SECTIONS {\n .persistent : {\n *(.persistent .persistent.*)\n }\n} INSERT BEFORE .data;\n\nASSERT(DEFINED(_reset), \"_reset is not defined\")\n\nENTRY(_reset)\n__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64imac-sel4-microkit-resettable.json b/support/targets/riscv64imac-sel4-microkit-resettable.json index 29655939c..d84247b60 100644 --- a/support/targets/riscv64imac-sel4-microkit-resettable.json +++ b/support/targets/riscv64imac-sel4-microkit-resettable.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+c", diff --git a/support/targets/riscv64imac-sel4-microkit-unwind.json b/support/targets/riscv64imac-sel4-microkit-unwind.json new file mode 100644 index 000000000..010795fca --- /dev/null +++ b/support/targets/riscv64imac-sel4-microkit-unwind.json @@ -0,0 +1,29 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "link-script": "__sel4_ipc_buffer_obj = (__ehdr_start & ~(4096 - 1)) - 4096;", + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64imac-sel4-microkit.json b/support/targets/riscv64imac-sel4-microkit.json index 66461c4a2..a6d6af6d4 100644 --- a/support/targets/riscv64imac-sel4-microkit.json +++ b/support/targets/riscv64imac-sel4-microkit.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+c", diff --git a/support/targets/riscv64imac-sel4-musl.json b/support/targets/riscv64imac-sel4-musl.json index 3d306a365..7230110e1 100644 --- a/support/targets/riscv64imac-sel4-musl.json +++ b/support/targets/riscv64imac-sel4-musl.json @@ -6,6 +6,7 @@ "crt-static-default": true, "crt-static-respected": true, "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "env": "musl", "exe-suffix": ".elf", diff --git a/support/targets/riscv64imac-sel4-unwind-musl.json b/support/targets/riscv64imac-sel4-unwind-musl.json new file mode 100644 index 000000000..71c6f7cad --- /dev/null +++ b/support/targets/riscv64imac-sel4-unwind-musl.json @@ -0,0 +1,35 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "env": "musl", + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-family": [ + "unix" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64imac-sel4-unwind.json b/support/targets/riscv64imac-sel4-unwind.json new file mode 100644 index 000000000..f5cccf74d --- /dev/null +++ b/support/targets/riscv64imac-sel4-unwind.json @@ -0,0 +1,28 @@ +{ + "arch": "riscv64", + "code-model": "medium", + "cpu": "generic-rv64", + "crt-objects-fallback": "false", + "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "emit-debug-gdb-scripts": false, + "exe-suffix": ".elf", + "features": "+m,+a,+c", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-abiname": "lp64", + "llvm-target": "riscv64", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "relocation-model": "static", + "supported-sanitizers": [ + "shadow-call-stack", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/riscv64imac-sel4.json b/support/targets/riscv64imac-sel4.json index b694fd625..68fdcb3d6 100644 --- a/support/targets/riscv64imac-sel4.json +++ b/support/targets/riscv64imac-sel4.json @@ -4,6 +4,7 @@ "cpu": "generic-rv64", "crt-objects-fallback": "false", "data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128", + "eh-frame-header": false, "emit-debug-gdb-scripts": false, "exe-suffix": ".elf", "features": "+m,+a,+c", diff --git a/support/targets/x86_64-sel4-musl.json b/support/targets/x86_64-sel4-musl.json index c6bae3bd9..670c1acd1 100644 --- a/support/targets/x86_64-sel4-musl.json +++ b/support/targets/x86_64-sel4-musl.json @@ -7,6 +7,7 @@ "crt-static-respected": true, "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, + "eh-frame-header": false, "env": "musl", "exe-suffix": ".elf", "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float", diff --git a/support/targets/x86_64-sel4-unwind-musl.json b/support/targets/x86_64-sel4-unwind-musl.json new file mode 100644 index 000000000..88b326407 --- /dev/null +++ b/support/targets/x86_64-sel4-unwind-musl.json @@ -0,0 +1,38 @@ +{ + "arch": "x86_64", + "code-model": "small", + "cpu": "x86-64", + "crt-objects-fallback": "false", + "crt-static-default": true, + "crt-static-respected": true, + "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, + "env": "musl", + "exe-suffix": ".elf", + "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "x86_64-unknown-none-elf", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "os": "linux", + "plt-by-default": false, + "relro-level": "full", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-family": [ + "unix" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/x86_64-sel4-unwind.json b/support/targets/x86_64-sel4-unwind.json new file mode 100644 index 000000000..184095727 --- /dev/null +++ b/support/targets/x86_64-sel4-unwind.json @@ -0,0 +1,31 @@ +{ + "arch": "x86_64", + "code-model": "small", + "cpu": "x86-64", + "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", + "disable-redzone": true, + "exe-suffix": ".elf", + "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float", + "has-thread-local": true, + "linker": "rust-lld", + "linker-flavor": "gnu-lld", + "llvm-target": "x86_64-unknown-none-elf", + "max-atomic-width": 64, + "metadata": { + "description": null, + "host_tools": null, + "std": null, + "tier": null + }, + "plt-by-default": false, + "relro-level": "full", + "stack-probes": { + "kind": "inline" + }, + "supported-sanitizers": [ + "kcfi", + "kernel-address" + ], + "target-pointer-width": "64" +} diff --git a/support/targets/x86_64-sel4.json b/support/targets/x86_64-sel4.json index 34bae4f59..706281d45 100644 --- a/support/targets/x86_64-sel4.json +++ b/support/targets/x86_64-sel4.json @@ -5,6 +5,7 @@ "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", "disable-redzone": true, + "eh-frame-header": false, "exe-suffix": ".elf", "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float", "has-thread-local": true,