diff --git a/.sync/Files.yml b/.sync/Files.yml index 4c5ae51..cfac0e1 100644 --- a/.sync/Files.yml +++ b/.sync/Files.yml @@ -146,8 +146,6 @@ group: - files: - source: .sync/rust/config.toml dest: .cargo/config.toml - template: - include_uefi_target_rules: false repos: | OpenDevicePartnership/patina OpenDevicePartnership/patina-apps diff --git a/.sync/rust/config.toml b/.sync/rust/config.toml index b780078..464ad76 100644 --- a/.sync/rust/config.toml +++ b/.sync/rust/config.toml @@ -4,23 +4,71 @@ # - Patina DevOps Repo: https://github.com/OpenDevicePartnership/patina-devops # - File Sync Settings: https://github.com/OpenDevicePartnership/patina-devops/blob/main/.sync/Files.yml -[net] -git-fetch-with-cli = true +[env] +PATINA_CONFIG_VERSION = "1" + +[profile.dev] +# optimize for size +opt-level = "s" +# generate all debug info +debug = true +# retain all debug info +strip = "none" +# assert on debug_assert +debug-assertions = true +# all addition/subtraction can cause panics with overflow/underflow +overflow-checks = true +# do fat LTO +lto = true +# do incremental builds for better compile times +incremental = true + +[profile.release] +# optimize for size +opt-level = "s" +# no debug info generated +debug = false +# do fat LTO +lto = true +# do not assert on debug_assert +debug-assertions = false +# no panic on overflow/underflow +overflow-checks = false +# do incremental builds for better compile times +incremental = true + +[profile.test] +# no optimizations +opt-level = 0 +# generate all debug info +debug = true +# retain all debug info +strip = "none" +# test with debug assertions off so we are testing the release case +debug-assertions = false +# keep the overflow checks to catch these in tests +overflow-checks = true +# disable LTO +lto = false +# do incremental builds for better compile times +incremental = true -{% if include_uefi_target_rules %} [target.x86_64-unknown-uefi] rustflags = [ - "-C", "link-arg=/base:0x0", - "-C", "link-arg=/subsystem:{{ subsystem_type | default("efi_boot_service_driver") }}", - "-C", "force-unwind-tables", # Generates .pdata section for stack tracing - "-C", "link-arg=/PDBALTPATH:{{ x86_64_pdb_name | default("x86_64_bin.pdb") }}", + # The Patina binary is a boot service driver + "-C", "link-arg=/subsystem:efi_boot_service_driver", + # Forcing frame pointers allows for better stack walking + "-C", "force-frame-pointers", + # Preserve stack unwind info + "-C", "force-unwind-tables", ] [target.aarch64-unknown-uefi] rustflags = [ - "-C", "link-arg=/base:0x0", - "-C", "link-arg=/subsystem:{{ subsystem_type | default("efi_boot_service_driver") }}", - "-C", "force-unwind-tables", # Generates .pdata section for stack tracing - "-C", "link-arg=/PDBALTPATH:{{ aarch64_pdb_name | default("aarch64_bin.pdb") }}", + # The Patina binary is a boot service driver + "-C", "link-arg=/subsystem:efi_boot_service_driver", + # Forcing frame pointers allows for better stack walking + "-C", "force-frame-pointers", + # Preserve stack unwind info + "-C", "force-unwind-tables", ] -{% endif %}