Skip to content

Commit

Permalink
Set ImageBase to 0 and Subsystem to EFI Boot Services in config.toml (#…
Browse files Browse the repository at this point in the history
…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]>
  • Loading branch information
makubacki authored Aug 9, 2024
1 parent 7f95228 commit f1cd14d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .sync/Files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -697,3 +697,15 @@ group:
microsoft/mu_basecore
microsoft/mu_plus
microsoft/mu_tiano_platforms
# Rust - Config (for UEFI builds)
- files:
- source: .sync/rust_config/config.toml
dest: .cargo/config.toml
repos: |
microsoft/mu_basecore
microsoft/mu_plus
microsoft/mu_rust_helpers
microsoft/mu_rust_hid
microsoft/mu_rust_pi
microsoft/mu_tiano_platforms
17 changes: 17 additions & 0 deletions .sync/rust_config/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[target.x86_64-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]

[target.i686-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]

[target.aarch64-unknown-uefi]
rustflags = [
"-C", "link-arg=/base:0x0",
"-C", "link-arg=/subsystem:efi_boot_service_driver",
]

0 comments on commit f1cd14d

Please sign in to comment.