[libcxx-commits] [libcxx] [libcxx] Recognize __UEFI__ predefine (PR #139327)

Prabhu Rajasekaran via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 9 15:34:35 PDT 2025


https://github.com/Prabhuk updated https://github.com/llvm/llvm-project/pull/139327

>From 89914ade6471ef35b2377f07e3b4d95d6c2a7ecd Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Fri, 9 May 2025 21:31:17 +0000
Subject: [PATCH] [libcxx] Recognize __UEFI__ predefine

The new target triple x86_64-uefi does not set _WIN32 macro. It sets a
new predefine __UEFI__. Update platform to recognize if the target
object format is COFF based on __UEFI__ as well.
---
 libcxx/include/__configuration/platform.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libcxx/include/__configuration/platform.h b/libcxx/include/__configuration/platform.h
index f3c199dee172b..4a414d00e2208 100644
--- a/libcxx/include/__configuration/platform.h
+++ b/libcxx/include/__configuration/platform.h
@@ -20,7 +20,7 @@
 #  define _LIBCPP_OBJECT_FORMAT_ELF 1
 #elif defined(__MACH__)
 #  define _LIBCPP_OBJECT_FORMAT_MACHO 1
-#elif defined(_WIN32)
+#elif defined(_WIN32) || defined(__UEFI__)
 #  define _LIBCPP_OBJECT_FORMAT_COFF 1
 #elif defined(__wasm__)
 #  define _LIBCPP_OBJECT_FORMAT_WASM 1



More information about the libcxx-commits mailing list