This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[google] Hide all uses of __float128 from Clang (issue6195066)


Hide all uses of __float128 from Clang.

Brackets _GLIBCXX_USE_FLOAT128 with #ifndef __clang__.  Clang does not
currently support the __float128 builtin, and so will fail to process
libstdc++ headers that use it.

Tested for full bootstrap and dejagnu testsuite.

Okay for google/integration and google/gcc-4_7-integration branches?

Thanks.


2012-05-09   Simon Baldwin  <simonb@google.com>

	* libstdc++-v3/acinclude.m4: Bracket _GLIBCXX_USE_FLOAT128
	definition with	ifndef __clang__.
	* libstdc++-v3/config.h.in: Rebuild.

Index: libstdc++-v3/config.h.in
===================================================================
--- libstdc++-v3/config.h.in	(revision 187148)
+++ libstdc++-v3/config.h.in	(working copy)
@@ -799,8 +799,11 @@
    this host. */
 #undef _GLIBCXX_USE_DECIMAL_FLOAT
 
-/* Define if __float128 is supported on this host. */
+/* Define if __float128 is supported on this host.
+   Hide all uses of __float128 from Clang.  Google ref b/6422845  */
+#ifndef __clang__
 #undef _GLIBCXX_USE_FLOAT128
+#endif
 
 /* Defined if gettimeofday is available. */
 #undef _GLIBCXX_USE_GETTIMEOFDAY
Index: libstdc++-v3/acinclude.m4
===================================================================
--- libstdc++-v3/acinclude.m4	(revision 187148)
+++ libstdc++-v3/acinclude.m4	(working copy)
@@ -2529,10 +2529,16 @@ int main()
 }
 EOF
 
+    AH_VERBATIM([_GLIBCXX_USE_FLOAT128,],
+                [/* Define if __float128 is supported on this host.
+   Hide all uses of __float128 from Clang.  Google ref b/6422845  */
+#ifndef __clang__
+#undef _GLIBCXX_USE_FLOAT128
+#endif])
+
     AC_MSG_CHECKING([for __float128])
     if AC_TRY_EVAL(ac_compile); then
-      AC_DEFINE(_GLIBCXX_USE_FLOAT128, 1,
-      [Define if __float128 is supported on this host.])
+      AC_DEFINE(_GLIBCXX_USE_FLOAT128, 1)
       enable_float128=yes
     else
       enable_float128=no

--
This patch is available for review at http://codereview.appspot.com/6195066


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]