diff --git a/Makefile b/Makefile index 684605c..f0ca453 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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=$@ diff --git a/targets/x86_64-unknown-uefi-drv.json b/targets/x86_64-unknown-uefi-drv.json deleted file mode 100644 index 0ec5c91..0000000 --- a/targets/x86_64-unknown-uefi-drv.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "abi-return-struct-as-int": true, - "allows-weak-linkage": false, - "arch": "x86_64", - "code-model": "large", - "cpu": "x86-64", - "data-layout": "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128", - "disable-redzone": true, - "emit-debug-gdb-scripts": false, - "env": "", - "exe-suffix": ".efi", - "executables": true, - "features": "-mmx,-sse,+soft-float", - "is-like-msvc": true, - "is-like-windows": true, - "linker": "rust-lld", - "linker-flavor": "lld-link", - "lld-flavor": "link", - "llvm-target": "x86_64-unknown-windows", - "max-atomic-width": 64, - "os": "uefi", - "panic-strategy": "abort", - "pre-link-args": { - "lld-link": [ - "/entry:efi_main", - "/heap:0,0", - "/stack:0,0", - "/dll", - "/base:0", - "/align:32", - "/filealign:32", - "/subsystem:efi_boot_service_driver" - ] - }, - "singlethread": true, - "stack-probes": { - "kind": "call" - }, - "target-c-int-width": "32", - "target-endian": "little", - "target-pointer-width": "64", - "vendor": "unknown" -}