]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
configure: Enable experimental support for clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 1 Dec 2025 20:09:48 +0000 (17:09 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 9 Dec 2025 11:58:10 +0000 (08:58 -0300)
The clang support is still experimental and not all testcases run
correctly.  Only clang 18 and onwards is supported and only
for x86_64-linux-gnu and aarch64-linux-gnu.

Reviewed-by: Collin Funk <collin.funk1@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
NEWS
configure
configure.ac

diff --git a/NEWS b/NEWS
index c420b67676ead0bc1c8b7426a219896e7597b75e..b70dc27ebb82e097ae4aecde434e8a81178faf79 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -49,6 +49,11 @@ Major new features:
 * The ISO C23 optional time base TIME_MONOTONIC, TIME_ACTIVE, and
   TIME_THREAD_ACTIVE have been added.
 
+* 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
index b80b9e5255dcf5c18a32654c4b4097db4ebf0616..9e79accc434821ed4e35158a407e4241b3776be2 100755 (executable)
--- 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
   ;
index ef9fdd1f59f906b1bd8b864cc60d8f9fb8311753..784e9e15a0f0463e8aea3a7bdaeace3c4fa9c307 100644 (file)
@@ -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],