[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:08:59 PST 2026
https://github.com/Prabhuk updated https://github.com/llvm/llvm-project/pull/239341
>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 1/2] [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
>From a710ce0ece795619b3433d4317312ea2ddcebe45 Mon Sep 17 00:00:00 2001
From: prabhukr <prabhukr at google.com>
Date: Thu, 5 Nov 2026 19:08:32 +0000
Subject: [PATCH 2/2] [libc][uefi] Fix CMake formatting
Format the UEFI compiler feature check the way the libc CMake formatter
expects.
Assisted-by: Claude
---
libc/cmake/modules/CheckCompilerFeatures.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/cmake/modules/CheckCompilerFeatures.cmake b/libc/cmake/modules/CheckCompilerFeatures.cmake
index af3423024e594e..970a7dc456f106 100644
--- a/libc/cmake/modules/CheckCompilerFeatures.cmake
+++ b/libc/cmake/modules/CheckCompilerFeatures.cmake
@@ -112,7 +112,7 @@ foreach(feature IN LISTS ALL_COMPILER_FEATURES)
set(has_feature TRUE)
endif()
elseif(LIBC_TARGET_OS_IS_UEFI AND
- feature IN_LIST UEFI_UNAVAILABLE_COMPILER_FEATURES)
+ feature IN_LIST UEFI_UNAVAILABLE_COMPILER_FEATURES)
set(has_feature FALSE)
else()
try_compile(
More information about the libc-commits
mailing list