Skip to content

Commit f1cd14d

Browse files
authored
Set ImageBase to 0 and Subsystem to EFI Boot Services in config.toml (#356)
Currently sets the ImageBase in the PE/COFF header to `0` as expected for UEFI images. The cargo config file will be synced to Rust enabled repos to apply the linker flags regardless of whether the Rust code is compiled directly or through the firmware build system. --------- Signed-off-by: Michael Kubacki <[email protected]>
1 parent 7f95228 commit f1cd14d

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.sync/Files.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,3 +697,15 @@ group:
697697
microsoft/mu_basecore
698698
microsoft/mu_plus
699699
microsoft/mu_tiano_platforms
700+
701+
# Rust - Config (for UEFI builds)
702+
- files:
703+
- source: .sync/rust_config/config.toml
704+
dest: .cargo/config.toml
705+
repos: |
706+
microsoft/mu_basecore
707+
microsoft/mu_plus
708+
microsoft/mu_rust_helpers
709+
microsoft/mu_rust_hid
710+
microsoft/mu_rust_pi
711+
microsoft/mu_tiano_platforms

.sync/rust_config/config.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[target.x86_64-unknown-uefi]
2+
rustflags = [
3+
"-C", "link-arg=/base:0x0",
4+
"-C", "link-arg=/subsystem:efi_boot_service_driver",
5+
]
6+
7+
[target.i686-unknown-uefi]
8+
rustflags = [
9+
"-C", "link-arg=/base:0x0",
10+
"-C", "link-arg=/subsystem:efi_boot_service_driver",
11+
]
12+
13+
[target.aarch64-unknown-uefi]
14+
rustflags = [
15+
"-C", "link-arg=/base:0x0",
16+
"-C", "link-arg=/subsystem:efi_boot_service_driver",
17+
]

0 commit comments

Comments
 (0)