bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isinf, isfinite on AIX


From: Bruno Haible
Subject: isinf, isfinite on AIX
Date: Sat, 18 Jun 2011 20:26:52 +0200
User-agent: KMail/1.9.9

On AIX 6.1 and 7.1, the tests for isinf and isfinite don't link:

  xlc -D_ALL_SOURCE -O  -g   -o test-isinf test-isinf.o ../gllib/libgnu.a  
  ld: 0711-317 ERROR: Undefined symbol: ._isinff

  xlc -D_ALL_SOURCE -O  -g   -o test-isfinite test-isfinite.o ../gllib/libgnu.a 
 
  ld: 0711-317 ERROR: Undefined symbol: ._isfinitef

It would link if ISINF_LIBM and ISFINITE_LIBM were set to "-lm" instead of
empty. This fixes it:


2011-06-18  Bruno Haible  <address@hidden>

        isfinite, isinf: Fix link error on AIX 6 and 7.
        * m4/isfinite.m4 (gl_ISFINITE): When determining whether libm is
        needed, also test the macro with a 'float' argument.
        * m4/isinf.m4 (gl_ISINF): Likewise.

--- m4/isfinite.m4.orig Sat Jun 18 20:23:29 2011
+++ m4/isfinite.m4      Sat Jun 18 20:22:06 2011
@@ -1,4 +1,4 @@
-# isfinite.m4 serial 9
+# isfinite.m4 serial 10
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,8 @@
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_DECLS([isfinite], , , [#include <math.h>])
   if test "$ac_cv_have_decl_isfinite" = yes; then
-    gl_CHECK_MATH_LIB([ISFINITE_LIBM], [x = isfinite (x);])
+    gl_CHECK_MATH_LIB([ISFINITE_LIBM],
+     [x = isfinite (x) + isfinite ((float) x);])
     if test "$ISFINITE_LIBM" != missing; then
       dnl Test whether isfinite() on 'long double' works.
       gl_ISFINITEL_WORKS
--- m4/isinf.m4.orig    Sat Jun 18 20:23:29 2011
+++ m4/isinf.m4 Sat Jun 18 20:22:06 2011
@@ -1,4 +1,4 @@
-# isinf.m4 serial 4
+# isinf.m4 serial 5
 dnl Copyright (C) 2007-2011 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,7 +11,7 @@
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
   AC_CHECK_DECLS([isinf], , , [#include <math.h>])
   if test "$ac_cv_have_decl_isinf" = yes; then
-    gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x);])
+    gl_CHECK_MATH_LIB([ISINF_LIBM], [x = isinf (x) + isinf ((float) x);])
     if test "$ISINF_LIBM" != missing; then
       dnl Test whether isinf() on 'long double' works.
       gl_ISINFL_WORKS


-- 
In memoriam Mona Mahmudnizhad <http://en.wikipedia.org/wiki/Mona_Mahmudnizhad>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]