]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
powerpc: Fix -mlong-double-128 IBM format configure test for Clang
authorMatt Turner <mattst88@gmail.com>
Sun, 26 Jul 2026 18:43:11 +0000 (14:43 -0400)
committerSam James <sam@gentoo.org>
Thu, 6 Aug 2026 22:12:25 +0000 (23:12 +0100)
The check for -mlong-double-128 IBM extended format support wrapped its
test code in AC_LANG_PROGRAM, which places the body inside main().  The
body defines a function, so it became a nested function definition -- a
GCC extension that Clang does not implement, making the test fail with
Clang.

Use AC_LANG_SOURCE so the function is defined at file scope, and
regenerate configure.

Reviewed-by: Sam James <sam@gentoo.org>
sysdeps/unix/sysv/linux/powerpc/configure
sysdeps/unix/sysv/linux/powerpc/configure.ac

index ef2055db92dd6c8af348e90332e98833e38251dd..eb8578404f4084f15cbad2a7f076757f636c4848 100644 (file)
@@ -12,18 +12,12 @@ else case e in #(
 CFLAGS="$CFLAGS -mlong-double-128"
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <float.h>
-int
-main (void)
-{
 
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif
 long double foobar (long double x) { return x; }
-  ;
-  return 0;
-}
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"
 then :
index 42347a66fc99f5132ba412bada586c6e6bab6909..ca0f82da08f4bdc8f73b3a6747ab5b419fe94350 100644 (file)
@@ -6,7 +6,8 @@ AC_CACHE_CHECK(whether $CC $CFLAGS -mlong-double-128 uses IBM extended format,
               libc_cv_mlong_double_128ibm, [dnl
 save_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS -mlong-double-128"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <float.h>]], [[
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+#include <float.h>
 #if LDBL_MANT_DIG != 106
 # error "compiler doesn't implement IBM extended format of long double"
 #endif