[libc-commits] [libc] [libc] Exclude Fuchsia from float128 detection (PR #73985)

Caslyn Tonelli via libc-commits libc-commits at lists.llvm.org
Fri Dec 1 10:14:00 PST 2023


https://github.com/Caslyn updated https://github.com/llvm/llvm-project/pull/73985

>From e2970ee3bcf93d2940b2fa5a281025be3e76c447 Mon Sep 17 00:00:00 2001
From: Caslyn Tonelli <caslyn at google.com>
Date: Thu, 30 Nov 2023 10:22:34 -0800
Subject: [PATCH 1/2] [libc] Exclude Fuchsia from float128 detection

Fuchsia targets currently don't support `float128`. Add detection for
`LIBC_TARGET_OS_IS_FUCHSIA`, and exclude this OS from setting
`LIBC_COMPILER_HAS_FLOAT128_EXTENSION`.
---
 libc/src/__support/macros/properties/float.h | 3 ++-
 libc/src/__support/macros/properties/os.h    | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libc/src/__support/macros/properties/float.h b/libc/src/__support/macros/properties/float.h
index 7e00ddc8f0cd327..69d3ec400c37c53 100644
--- a/libc/src/__support/macros/properties/float.h
+++ b/libc/src/__support/macros/properties/float.h
@@ -62,7 +62,8 @@ using float16 = _Float16;
 #define LIBC_COMPILER_HAS_C23_FLOAT128
 #endif
 #if (defined(LIBC_COMPILER_CLANG_VER) && (LIBC_COMPILER_CLANG_VER >= 500)) &&  \
-    (defined(LIBC_TARGET_ARCH_IS_X86_64))
+    (defined(LIBC_TARGET_ARCH_IS_X86_64) &&                                    \
+     !defined(LIBC_TARGET_OS_IS_FUCHSIA))
 #define LIBC_COMPILER_HAS_FLOAT128_EXTENSION
 #endif
 
diff --git a/libc/src/__support/macros/properties/os.h b/libc/src/__support/macros/properties/os.h
index 92e68b3e6612a82..ff0b29fd50c1751 100644
--- a/libc/src/__support/macros/properties/os.h
+++ b/libc/src/__support/macros/properties/os.h
@@ -37,4 +37,8 @@
 #endif
 #endif
 
+#if (defined(__Fuchsia__))
+#define LIBC_TARGET_OS_IS_FUCHSIA
+#endif
+
 #endif // LLVM_LIBC_SRC___SUPPORT_MACROS_PROPERTIES_OS_H

>From c40e9347d9e104fd5c93569680ae25935dffab25 Mon Sep 17 00:00:00 2001
From: Caslyn Tonelli <caslyn at google.com>
Date: Fri, 1 Dec 2023 09:54:12 -0800
Subject: [PATCH 2/2] remove extraneous parens

---
 libc/src/__support/macros/properties/os.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libc/src/__support/macros/properties/os.h b/libc/src/__support/macros/properties/os.h
index ff0b29fd50c1751..1c8fd5721ce679c 100644
--- a/libc/src/__support/macros/properties/os.h
+++ b/libc/src/__support/macros/properties/os.h
@@ -37,7 +37,7 @@
 #endif
 #endif
 
-#if (defined(__Fuchsia__))
+#if defined(__Fuchsia__)
 #define LIBC_TARGET_OS_IS_FUCHSIA
 #endif
 



More information about the libc-commits mailing list