]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
configure: remove overly restrictive check for clang
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Sun, 26 Sep 2021 05:03:08 +0000 (22:03 -0700)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 28 Oct 2025 16:45:23 +0000 (13:45 -0300)
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
configure
configure.ac

diff --git a/NEWS b/NEWS
index 244f7613d871c8cb285a3cd6771ab4ce095621fd..b4348ac51b76b27c7bd278de676fc018c0bf0ddb 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -13,6 +13,11 @@ Major new features:
 
 * The ISO C23 memalignment function has been added.
 
+* Initial 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 3c926be3ecd9ff4412f0496d72d632fd8cf9e890..a21ce56302ac851416a9cda9f88efca28cb2a6cd 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
   ;
@@ -7642,7 +7642,7 @@ else case e in #(
 extern char *strstr (const char *, const char *) __asm ("my_strstr");
 char *foo (const char *a, const char *b)
 {
-  return __builtin_strstr (a, b);
+  return strstr (a, b);
 }
 EOF
 if { ac_try='${CC-cc} -O3 -S conftest.c -o - | grep -F "my_strstr" > /dev/null'
index 890f1b1c9c300d4d3644fb542aac4f7cb01bf5e6..29c45632fd1590d54601c79de0ea846ef3c19908 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],
@@ -1474,7 +1474,7 @@ cat > conftest.c <<\EOF
 extern char *strstr (const char *, const char *) __asm ("my_strstr");
 char *foo (const char *a, const char *b)
 {
-  return __builtin_strstr (a, b);
+  return strstr (a, b);
 }
 EOF
 dnl