Files
buildroot/package/llvm-project/compiler-rt/0001-libc-Fix-detection-of-cfloat128.patch
Bernd Kuhls 25cb3813e7 package/llvm-project: bump version to 22.1.0
Subproject tarballs are not provided anymore:
https://discourse.llvm.org/t/llvm-22-1-0-released/89950
"Please note since the last release the subproject tarballs have been
 removed"
https://discourse.llvm.org/t/rfc-do-something-with-the-subproject-tarballs-in-the-release-page/75024/14

Used upstream tarball llvm-project-22.1.0.src.tar.xz for all packages
and linked subproject hash files to ../llvm-project.hash.

Removed patches which fix build errors caused by subproject tarballs.

Removed handling of third-party-21.1.8.src.tar.xz which is included in
the monolithic tarball.

Added _SUBDIR variable or updated _INSTALL_CMDS when needed.

For compiler-rt:

Removed both patches, they are not needed anymore.

Added patch to fix aarch64 build.

Added dependency on gcc >= 15.x because libcxx now depends on gcc >=
15.x: https://github.com/llvm/llvm-project/pull/165684
  warning "Libc++ only supports GCC 15 and later"

Building with gcc 14.x causes many build errors like

output/build/compiler-rt-22.1.0/compiler-rt/buildroot-build/lib/fuzzer/libcxx_fuzzer_x86_64/build/include/c++/v1/__type_traits/is_array.h:43:68:
 error: expected primary-expression before ')' token

output/build/compiler-rt-22.1.0/compiler-rt/buildroot-build/lib/fuzzer/libcxx_fuzzer_x86_64/build/include/c++/v1/__type_traits/is_array.h:43:44:
 error: there are no arguments to '__is_unbounded_array' that depend on
 a template parameter, so a declaration of '__is_unbounded_array' must
 be available [-fpermissive]

output/build/compiler-rt-22.1.0/compiler-rt/buildroot-build/lib/fuzzer/libcxx_fuzzer_x86_64/build/include/c++/v1/__type_traits/decay.h:22:32:
 error: expected type-specifier before '__decay'

A corresponding bug report sent upstream
https://github.com/llvm/llvm-project/issues/174203

was answered:
https://github.com/llvm/llvm-project/issues/174203#issuecomment-3711113919
"Our policy is rather clear: Only the latest GCC is supported."

and an update to supported compiler versions was committed:
d1146b1ddd

Updated TestClangCompilerRT to use a gcc 15-based toolchain.

Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
Signed-off-by: Julien Olivain <ju.o@free.fr>
2026-03-10 19:11:18 +01:00

71 lines
2.5 KiB
Diff

From 4e1af872f819782bd233ab21953ab92cf36ff9c3 Mon Sep 17 00:00:00 2001
From: Bernd Kuhls <bernd@kuhls.net>
Date: Mon, 9 Mar 2026 19:07:10 +0100
Subject: [PATCH] [libc] Fix detection of cfloat128
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__.
Upstream: https://github.com/llvm/llvm-project/pull/185486
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
---
libc/include/llvm-libc-macros/cfloat128-macros.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/include/llvm-libc-macros/cfloat128-macros.h b/libc/include/llvm-libc-macros/cfloat128-macros.h
index 5f28cfa21aae..ff4aa530685d 100644
--- a/libc/include/llvm-libc-macros/cfloat128-macros.h
+++ b/libc/include/llvm-libc-macros/cfloat128-macros.h
@@ -27,7 +27,7 @@
#define LIBC_TYPES_HAS_CFLOAT128
#endif
#elif defined(__GNUC__)
-#if (defined(__STDC_IEC_60559_COMPLEX__) || defined(__SIZEOF_FLOAT128__)) && \
+#if (defined(__STDC_IEC_60559_COMPLEX__) && defined(__SIZEOF_FLOAT128__)) && \
(__GNUC__ >= 13 || (!defined(__cplusplus)))
#define LIBC_TYPES_HAS_CFLOAT128
#endif
--
2.47.3