]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
math: Fix `unknown type name '__float128'` for clang 3.4 to 3.8.1 (bug 32694)
authorkoraynilay <koray.fra@gmail.com>
Sat, 22 Feb 2025 14:55:59 +0000 (15:55 +0100)
committerH.J. Lu <hjl.tools@gmail.com>
Sun, 23 Feb 2025 05:37:58 +0000 (13:37 +0800)
When compiling a program that includes <bits/floatn.h> using a clang version
between 3.4 (included) and 3.8.1 (included), clang will fail with `unknown type
name '__float128'; did you mean '__cfloat128'?`. This changes fixes the clang
prerequirements macro call in floatn.h to check for clang 3.9 instead of 3.4,
since support for __float128 was actually enabled in 3.9 by:

commit 50f29e06a1b6a38f0bba9360cbff72c82d46cdd4
Author: Nemanja Ivanovic <nemanja.i.ibm@gmail.com>
Date:   Wed Apr 13 09:49:45 2016 +0000

    Enable support for __float128 in Clang

This fixes bug 32694.

Signed-off-by: koraynilay <koray.fra@gmail.com>
Reviewed-by: H.J. Lu <hjl.tools@gmail.com>
(cherry picked from commit 29803ed3ce420f01e7c567c97fc8945d5e5e5992)

sysdeps/x86/bits/floatn.h

index adc7ed2e9e861c306fe9cdc371e767eda56ec8c4..4674165bd77aec931f6fbf2a392dcdaa8b262f74 100644 (file)
@@ -31,7 +31,7 @@
 #if (defined __x86_64__                                                        \
      ? __GNUC_PREREQ (4, 3)                                            \
      : (defined __GNU__ ? __GNUC_PREREQ (4, 5) : __GNUC_PREREQ (4, 4))) \
-    || (__glibc_clang_prereq (3, 4)                                    \
+    || (__glibc_clang_prereq (3, 9)                                    \
        && (!defined __INTEL_LLVM_COMPILER                              \
            || !defined SYCL_LANGUAGE_VERSION))
 # define __HAVE_FLOAT128 1
@@ -93,7 +93,7 @@ typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__)));
 /* The type _Float128 exists only since GCC 7.0.  */
 #  if !__GNUC_PREREQ (7, 0) \
       || (defined __cplusplus && !__GNUC_PREREQ (13, 0)) \
-      || __glibc_clang_prereq (3, 4)
+      || __glibc_clang_prereq (3, 9)
 typedef __float128 _Float128;
 #  endif