Skip to content

Commit

Permalink
Use x86_64-unknown-uefi target
Browse files Browse the repository at this point in the history
The custom target specification for UEFI drivers has drifted from the
x86_64-unknown-uefi target as the toolchain has been updated.

Replace the custom target for UEFI drivers with the base target plus our
custom link arguments for making it a UEFI driver.

The link arguments are preserved to minimize the differences in the
binary, but only overriding the subsystem should be necessary.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd authored and jackpot51 committed May 26, 2024
1 parent eb67f55 commit 9d9e8e7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 49 deletions.
17 changes: 11 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
TARGET?=x86_64-unknown-uefi-drv
# SPDX-License-Identifier: GPL-3.0-only

export LD=ld
export RUST_TARGET_PATH=$(CURDIR)/targets
BUILD=build/$(TARGET)
TARGET = x86_64-unknown-uefi
BUILD = build/$(TARGET)

all: $(BUILD)/boot.efi

Expand Down Expand Up @@ -43,8 +42,14 @@ $(BUILD)/boot.efi: Cargo.lock Cargo.toml src/*
mkdir -p $(BUILD)
cargo rustc \
-Z build-std=core,alloc \
--target=$(TARGET) \
--target $(TARGET) \
--release \
-- \
-C soft-float \
-C link-arg=/heap:0,0 \
-C link-arg=/stack:0,0 \
-C link-arg=/dll \
-C link-arg=/base:0 \
-C link-arg=/align:32 \
-C link-arg=/filealign:32 \
-C link-arg=/subsystem:efi_boot_service_driver \
--emit link=$@
43 changes: 0 additions & 43 deletions targets/x86_64-unknown-uefi-drv.json

This file was deleted.

0 comments on commit 9d9e8e7

Please sign in to comment.