From 758868cb09bca3a97e18debb7058af8dc5f76f62 Mon Sep 17 00:00:00 2001 From: Ayush Singh Date: Tue, 8 Nov 2022 23:01:15 +0530 Subject: [PATCH] Return .efi extension for EFI executable Originally part of https://github.com/rust-lang/rust/pull/100316 Signed-off-by: Ayush Singh --- src/bootstrap/util.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 20c3801f0a502..73cea126e395c 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -44,7 +44,13 @@ pub use t; /// Given an executable called `name`, return the filename for the /// executable for a particular target. pub fn exe(name: &str, target: TargetSelection) -> String { - if target.contains("windows") { format!("{}.exe", name) } else { name.to_string() } + if target.contains("windows") { + format!("{}.exe", name) + } else if target.contains("uefi") { + format!("{}.efi", name) + } else { + name.to_string() + } } /// Returns `true` if the file name given looks like a dynamic library.