[libc-commits] [libc] [libc][uefi] Disable fixed point types for UEFI (PR #239341)

Prabhu Rajasekaran via libc-commits libc-commits at lists.llvm.org
Thu Nov 5 11:03:55 PST 2026


https://github.com/Prabhuk created https://github.com/llvm/llvm-project/pull/239341

Report the fixed point compiler feature as unavailable on UEFI. The
Microsoft C++ ABI that UEFI uses cannot mangle fixed point types yet, so
any entrypoint that instantiates a template with one fails to compile.

Assisted-by: Claude


>From 32a7e0642b7cbdca38a644cb86530ef01dd52130 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Sat, 17 Oct 2026 01:01:52 -0700
Subject: [PATCH] [libc][uefi] Disable fixed point types for UEFI

Report the fixed point compiler feature as unavailable on UEFI. The
Microsoft C++ ABI that UEFI uses cannot mangle fixed point types yet, so
any entrypoint that instantiates a template with one fails to compile.

Assisted-by: Claude
---
 libc/cmake/modules/CheckCompilerFeatures.cmake | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libc/cmake/modules/CheckCompilerFeatures.cmake b/libc/cmake/modules/CheckCompilerFeatures.cmake
index eaf702710b1cce..af3423024e594e 100644
--- a/libc/cmake/modules/CheckCompilerFeatures.cmake
+++ b/libc/cmake/modules/CheckCompilerFeatures.cmake
@@ -62,6 +62,14 @@ endfunction()
 
 set(AVAILABLE_COMPILER_FEATURES "")
 
+# Compiler features that are unavailable on UEFI targets. UEFI uses the
+# Microsoft C++ ABI, whose name mangler does not support fixed point types yet,
+# so any template instantiated with a fixed point type fails to compile.
+set(
+  UEFI_UNAVAILABLE_COMPILER_FEATURES
+    "fixed_point"
+)
+
 # Try compile a C file to check if flag is supported.
 foreach(feature IN LISTS ALL_COMPILER_FEATURES)
   set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
@@ -103,6 +111,9 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES)
     else()
       set(has_feature TRUE)
     endif()
+  elseif(LIBC_TARGET_OS_IS_UEFI AND
+         feature IN_LIST UEFI_UNAVAILABLE_COMPILER_FEATURES)
+    set(has_feature FALSE)
   else()
     try_compile(
       has_feature



More information about the libc-commits mailing list