[PATCH v4 12/12] configure: remove overly restrictive check for clang
Adhemerval Zanella
adhemerval.zanella@linaro.org
Mon Nov 10 13:29:03 GMT 2025
The clang support is still experimental and not all testcase build
or run correctly. Only clang 18 and onwards is supported and only
for x86_64-linux-gnu and aarch64-linux-gnu.
---
NEWS | 5 +++++
configure | 2 +-
configure.ac | 2 +-
3 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/NEWS b/NEWS
index 0f01b751f98..1a14d125640 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,11 @@ Major new features:
platforms supporting _Float128) _Float128_t, introduced in TS
18661-3:2015, have been added to <math.h>.
+* Experimental support for building with clang has been added. It requires
+ at least clang version 18, aarch64-linux-gnu or x86_64-linux-gnu
+ targets, and libgcc compatible runtime (including libgcc_s.so for
+ pthread cancellation and backtrace runtime support).
+
Deprecated and removed features, and other changes affecting compatibility:
* Support for dumped heaps has been removed - malloc_set_state() now always
diff --git a/configure b/configure
index e490bb95f54..eb94c8577f7 100755
--- a/configure
+++ b/configure
@@ -5799,7 +5799,7 @@ int
main (void)
{
-#if !defined __GNUC__ || __GNUC__ < 12 || (__GNUC__ == 12 && __GNUC_MINOR__ < 1)
+#if (!defined __GNUC__ || __GNUC__ < 12 || (__GNUC__ == 12 && __GNUC_MINOR__ < 1)) && (!defined __clang__ || __clang_major__ < 18)
#error insufficient compiler
#endif
;
diff --git a/configure.ac b/configure.ac
index c9939a6db2a..9be9f566123 100644
--- a/configure.ac
+++ b/configure.ac
@@ -585,7 +585,7 @@ AC_CHECK_PROG_VER(BISON, bison, --version,
# Require GCC 12.1 to build.
AC_CACHE_CHECK([if $CC is sufficient to build libc], libc_cv_compiler_ok, [
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[]], [[
-#if !defined __GNUC__ || __GNUC__ < 12 || (__GNUC__ == 12 && __GNUC_MINOR__ < 1)
+#if (!defined __GNUC__ || __GNUC__ < 12 || (__GNUC__ == 12 && __GNUC_MINOR__ < 1)) && (!defined __clang__ || __clang_major__ < 18)
#error insufficient compiler
#endif]])],
[libc_cv_compiler_ok=yes],
--
2.43.0
More information about the Libc-alpha
mailing list