bkuhls
ea9f8b7746
[libc] Fix detection of cfloat128 (#185486)
Building compiler-rt with aarch64-buildroot-linux-gnu-gcc 15.2 causes a
build error:
```
compiler-rt-22.1.0/cmake/Modules/../../libc/src/__support/CPP/type_traits/is_complex.h:44:31:
error: 'cfloat128' was not declared in this scope; did you mean 'float128'? [-Wtemplate-body]
```
According to
https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gcc/Floating-Types.html
__float128 is not available on aarch64.
Analyzing the gcc defines for aarch64 seems to prove it:
```
$ aarch64-buildroot-linux-gnu-gcc -v
Target: aarch64-buildroot-linux-gnu
gcc version 15.2.0 (Buildroot 2026.02-114-gdadec9da56)
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep __GCC_IEC_559_COMPLEX
#define __GCC_IEC_559_COMPLEX 2
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep __STDC_IEC_60559_COMPLEX__
#define __STDC_IEC_60559_COMPLEX__ 201404L
$ echo | aarch64-buildroot-linux-gnu-gcc -dM -E - | grep -i float128
$
```
In contrast gcc for x86_64:
```
$ x86_64-buildroot-linux-gnu-gcc -v
Target: x86_64-buildroot-linux-gnu
gcc version 15.2.0 (Buildroot 2026.02-112-gd12ac02486)
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep __GCC_IEC_559_COMPLEX
#define __GCC_IEC_559_COMPLEX 2
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep __STDC_IEC_60559_COMPLEX__
#define __STDC_IEC_60559_COMPLEX__ 201404L
$ echo | x86_64-buildroot-linux-gnu-gcc -dM -E - | grep -i float128
#define __SIZEOF_FLOAT128__ 16
```
This patch changes the or-condition to an and-condition for
\_\_STDC_IEC_60559_COMPLEX\_\_ and \_\_SIZEOF_FLOAT128\_\_.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
2026-03-11 10:12:23 -04:00
..
2025-11-18 10:17:19 +08:00
2026-03-11 10:12:23 -04:00
2026-03-09 15:12:54 -07:00
2025-10-06 11:46:45 +08:00
2026-03-08 06:22:36 +00:00
2025-09-04 14:02:43 -07:00
2026-03-09 15:12:54 -07:00
2025-07-18 11:35:09 -07:00
2025-08-07 16:45:14 -07:00
2026-03-09 15:12:54 -07:00
2025-12-08 22:14:12 +05:30
2026-01-12 10:56:49 -08:00
2026-01-12 10:56:49 -08:00
2025-10-30 11:49:22 -07:00
2025-10-08 23:37:01 -04:00
2025-10-22 09:41:03 -07:00
2026-01-29 10:33:19 -08:00
2025-08-16 16:05:45 -07:00
2025-07-18 11:35:09 -07:00
2025-07-18 11:35:09 -07:00
2025-07-18 11:35:09 -07:00
2025-10-24 10:42:31 -07:00
2025-10-30 11:49:22 -07:00
2026-03-02 13:47:43 -08:00
2025-11-17 15:43:42 -08:00
2025-10-30 11:49:22 -07:00
2025-07-18 11:35:09 -07:00
2025-07-18 11:35:09 -07:00
2026-03-10 10:08:55 -07:00
2025-07-18 11:35:09 -07:00
2025-05-09 09:02:33 -07:00
2025-12-11 14:27:50 -08:00
2025-11-17 15:43:42 -08:00
2026-03-11 06:56:54 -07:00