[libc-commits] [libc] [libc][uefi] Disable fixed point types for UEFI (PR #239341)
via libc-commits
libc-commits at lists.llvm.org
Thu Nov 5 11:09:55 PST 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Prabhu Rajasekaran (Prabhuk)
<details>
<summary>Changes</summary>
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
---
Full diff: https://github.com/llvm/llvm-project/pull/239341.diff
1 Files Affected:
- (modified) libc/cmake/modules/CheckCompilerFeatures.cmake (+11)
``````````diff
diff --git a/libc/cmake/modules/CheckCompilerFeatures.cmake b/libc/cmake/modules/CheckCompilerFeatures.cmake
index eaf702710b1cce..970a7dc456f106 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
``````````
</details>
https://github.com/llvm/llvm-project/pull/239341
More information about the libc-commits
mailing list