Skip to content

[clang] UEFI default ABI #138364

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 8, 2025
Merged

[clang] UEFI default ABI #138364

merged 4 commits into from
May 8, 2025

Conversation

Prabhuk
Copy link
Contributor

@Prabhuk Prabhuk commented May 2, 2025

Set MS ABI as default ABI for UEFI.

Set MS ABI as default ABI for UEFI.
@llvmbot llvmbot added clang Clang issues not falling into any other category backend:X86 clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' labels May 2, 2025
@Prabhuk Prabhuk requested a review from petrhosek May 2, 2025 23:40
@llvmbot
Copy link
Member

llvmbot commented May 2, 2025

@llvm/pr-subscribers-backend-x86

@llvm/pr-subscribers-clang-driver

Author: Prabhu Rajasekaran (Prabhuk)

Changes

Set MS ABI as default ABI for UEFI.


Full diff: https://github.com/llvm/llvm-project/pull/138364.diff

1 Files Affected:

  • (modified) clang/lib/Driver/ToolChains/Arch/X86.cpp (+1-1)
diff --git a/clang/lib/Driver/ToolChains/Arch/X86.cpp b/clang/lib/Driver/ToolChains/Arch/X86.cpp
index e6ac3a9e4b350..eea0c9e2ae6e0 100644
--- a/clang/lib/Driver/ToolChains/Arch/X86.cpp
+++ b/clang/lib/Driver/ToolChains/Arch/X86.cpp
@@ -122,7 +122,7 @@ void x86::getX86TargetFeatures(const Driver &D, const llvm::Triple &Triple,
   // Claim and report unsupported -mabi=. Note: we don't support "sysv_abi" or
   // "ms_abi" as default function attributes.
   if (const Arg *A = Args.getLastArg(clang::driver::options::OPT_mabi_EQ)) {
-    StringRef DefaultAbi = Triple.isOSWindows() ? "ms" : "sysv";
+    StringRef DefaultAbi = Triple.isOSWindowsOrUEFI() ? "ms" : "sysv";
     if (A->getValue() != DefaultAbi)
       D.Diag(diag::err_drv_unsupported_opt_for_target)
           << A->getSpelling() << Triple.getTriple();

@Prabhuk Prabhuk requested a review from efriedma-quic May 7, 2025 23:25
@Prabhuk Prabhuk merged commit 5c6cbe2 into llvm:main May 8, 2025
11 checks passed
@Prabhuk Prabhuk deleted the uefi_defaultabi branch May 8, 2025 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 clang:driver 'clang' and 'clang++' user-facing binaries. Not 'clang-cl' clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants