bug-gnulib
[Top][All Lists]
Advanced

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

floorf, ceilf, floorl, ceill on Solaris


From: Bruno Haible
Subject: floorf, ceilf, floorl, ceill on Solaris
Date: Mon, 29 Oct 2007 03:20:02 +0100
User-agent: KMail/1.5.4

Hi,

On Solaris 10, with Sun C 5.0, in 32-bit mode, the functions floorf, ceilf,
floorl, ceill are declared, and are present in /lib/libm.so.2, but are not
defined in the libm that the compiler uses (libm.so.1 I guess). As a
consequence, the corresponding tests don't link.

So we need to check not only the declarations, but also for the presence in
libm. I'm applying this fix.


2007-10-28  Bruno Haible  <address@hidden>

        Fix link errors with Sun C 5.0 on Solaris 10.
        * m4/floorf.m4 (gl_FUNC_FLOORF): Consider also the case that the
        function is declared but not present in the compiler's libm.
        * m4/floorl.m4 (gl_FUNC_FLOORL): Likewise.
        * m4/ceilf.m4 (gl_FUNC_CEILF): Likewise.
        * m4/ceill.m4 (gl_FUNC_CEILL: Likewise.
        * lib/math.in.h: Test REPLACE_CEILF instead of HAVE_DECL_CEILF.
        Test REPLACE_CEILL instead of HAVE_DECL_CEILL.
        Test REPLACE_FLOORF instead of HAVE_DECL_FLOORF.
        Test REPLACE_FLOORL instead of HAVE_DECL_FLOORL.
        * m4/math_h.m4 (gl_MATH_H_DEFAULTS): Update.
        * modules/math (Makefile.am): Substitute REPLACE_CEILF instead of
        HAVE_DECL_CEILF, REPLACE_CEILL instead of HAVE_DECL_CEILL,
        REPLACE_FLOORF instead of HAVE_DECL_FLOORF, REPLACE_FLOORL instead of
        HAVE_DECL_FLOORL.

*** lib/math.in.h.orig  2007-10-29 03:09:44.000000000 +0100
--- lib/math.in.h       2007-10-29 02:52:27.000000000 +0100
***************
*** 90,96 ****
  
  
  #if @GNULIB_CEILF@
! # if address@hidden@
  #  define ceilf rpl_ceilf
  extern float ceilf (float x);
  # endif
--- 90,96 ----
  
  
  #if @GNULIB_CEILF@
! # if @REPLACE_CEILF@
  #  define ceilf rpl_ceilf
  extern float ceilf (float x);
  # endif
***************
*** 103,109 ****
  #endif
  
  #if @GNULIB_CEILL@
! # if address@hidden@
  #  define ceill rpl_ceill
  extern long double ceill (long double x);
  # endif
--- 103,109 ----
  #endif
  
  #if @GNULIB_CEILL@
! # if @REPLACE_CEILL@
  #  define ceill rpl_ceill
  extern long double ceill (long double x);
  # endif
***************
*** 141,147 ****
  
  
  #if @GNULIB_FLOORF@
! # if address@hidden@
  #  define floorf rpl_floorf
  extern float floorf (float x);
  # endif
--- 141,147 ----
  
  
  #if @GNULIB_FLOORF@
! # if @REPLACE_FLOORF@
  #  define floorf rpl_floorf
  extern float floorf (float x);
  # endif
***************
*** 154,160 ****
  #endif
  
  #if @GNULIB_FLOORL@
! # if address@hidden@
  #  define floorl rpl_floorl
  extern long double floorl (long double x);
  # endif
--- 154,160 ----
  #endif
  
  #if @GNULIB_FLOORL@
! # if @REPLACE_FLOORL@
  #  define floorl rpl_floorl
  extern long double floorl (long double x);
  # endif
*** m4/ceilf.m4.orig    2007-10-29 03:09:44.000000000 +0100
--- m4/ceilf.m4 2007-10-29 02:24:08.000000000 +0100
***************
*** 1,4 ****
! # ceilf.m4 serial 2
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # ceilf.m4 serial 3
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 15,28 ****
      dnl Test whether ceilf() can be used without libm.
      gl_FUNC_CEILF_LIBS
      if test "$CEILF_LIBM" = "?"; then
!       CEILF_LIBM=
      fi
    else
!     HAVE_DECL_CEILF=0
      AC_LIBOBJ([ceilf])
      CEILF_LIBM=
    fi
!   AC_SUBST([HAVE_DECL_CEILF])
    AC_SUBST([CEILF_LIBM])
  ])
  
--- 15,32 ----
      dnl Test whether ceilf() can be used without libm.
      gl_FUNC_CEILF_LIBS
      if test "$CEILF_LIBM" = "?"; then
!       dnl Sun C 5.0 on Solaris declares ceilf() and has it in the system-wide
!       dnl libm.so, but not in the libm.so that the compiler uses.
!       REPLACE_CEILF=1
      fi
    else
!     REPLACE_CEILF=1
!   fi
!   if test $REPLACE_CEILF = 1; then
      AC_LIBOBJ([ceilf])
      CEILF_LIBM=
    fi
!   AC_SUBST([REPLACE_CEILF])
    AC_SUBST([CEILF_LIBM])
  ])
  
*** m4/ceill.m4.orig    2007-10-29 03:09:44.000000000 +0100
--- m4/ceill.m4 2007-10-29 02:51:09.000000000 +0100
***************
*** 1,4 ****
! # ceill.m4 serial 2
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # ceill.m4 serial 3
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 15,28 ****
      dnl Test whether ceill() can be used without libm.
      gl_FUNC_CEILL_LIBS
      if test "$CEILL_LIBM" = "?"; then
!       CEILL_LIBM=
      fi
    else
!     HAVE_DECL_CEILL=0
      AC_LIBOBJ([ceill])
      CEILL_LIBM=
    fi
!   AC_SUBST([HAVE_DECL_CEILL])
    AC_SUBST([CEILL_LIBM])
  ])
  
--- 15,32 ----
      dnl Test whether ceill() can be used without libm.
      gl_FUNC_CEILL_LIBS
      if test "$CEILL_LIBM" = "?"; then
!       dnl Sun C 5.0 on Solaris declares ceill() and has it in the system-wide
!       dnl libm.so, but not in the libm.so that the compiler uses.
!       REPLACE_CEILL=1
      fi
    else
!     REPLACE_CEILL=1
!   fi
!   if test $REPLACE_CEILL = 1; then
      AC_LIBOBJ([ceill])
      CEILL_LIBM=
    fi
!   AC_SUBST([REPLACE_CEILL])
    AC_SUBST([CEILL_LIBM])
  ])
  
*** m4/floorf.m4.orig   2007-10-29 03:09:44.000000000 +0100
--- m4/floorf.m4        2007-10-29 02:23:59.000000000 +0100
***************
*** 1,4 ****
! # floorf.m4 serial 2
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # floorf.m4 serial 3
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 15,28 ****
      dnl Test whether floorf() can be used without libm.
      gl_FUNC_FLOORF_LIBS
      if test "$FLOORF_LIBM" = "?"; then
!       FLOORF_LIBM=
      fi
    else
!     HAVE_DECL_FLOORF=0
      AC_LIBOBJ([floorf])
      FLOORF_LIBM=
    fi
!   AC_SUBST([HAVE_DECL_FLOORF])
    AC_SUBST([FLOORF_LIBM])
  ])
  
--- 15,32 ----
      dnl Test whether floorf() can be used without libm.
      gl_FUNC_FLOORF_LIBS
      if test "$FLOORF_LIBM" = "?"; then
!       dnl Sun C 5.0 on Solaris declares floorf() and has it in the system-wide
!       dnl libm.so, but not in the libm.so that the compiler uses.
!       REPLACE_FLOORF=1
      fi
    else
!     REPLACE_FLOORF=1
!   fi
!   if test $REPLACE_FLOORF = 1; then
      AC_LIBOBJ([floorf])
      FLOORF_LIBM=
    fi
!   AC_SUBST([REPLACE_FLOORF])
    AC_SUBST([FLOORF_LIBM])
  ])
  
*** m4/floorl.m4.orig   2007-10-29 03:09:44.000000000 +0100
--- m4/floorl.m4        2007-10-29 02:50:32.000000000 +0100
***************
*** 1,4 ****
! # floorl.m4 serial 2
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # floorl.m4 serial 3
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 15,28 ****
      dnl Test whether floorl() can be used without libm.
      gl_FUNC_FLOORL_LIBS
      if test "$FLOORL_LIBM" = "?"; then
!       FLOORL_LIBM=
      fi
    else
!     HAVE_DECL_FLOORL=0
      AC_LIBOBJ([floorl])
      FLOORL_LIBM=
    fi
!   AC_SUBST([HAVE_DECL_FLOORL])
    AC_SUBST([FLOORL_LIBM])
  ])
  
--- 15,32 ----
      dnl Test whether floorl() can be used without libm.
      gl_FUNC_FLOORL_LIBS
      if test "$FLOORL_LIBM" = "?"; then
!       dnl Sun C 5.0 on Solaris declares floorl() and has it in the system-wide
!       dnl libm.so, but not in the libm.so that the compiler uses.
!       REPLACE_FLOORL=1
      fi
    else
!     REPLACE_FLOORL=1
!   fi
!   if test $REPLACE_FLOORL = 1; then
      AC_LIBOBJ([floorl])
      FLOORL_LIBM=
    fi
!   AC_SUBST([REPLACE_FLOORL])
    AC_SUBST([FLOORL_LIBM])
  ])
  
*** m4/math_h.m4.orig   2007-10-29 03:09:44.000000000 +0100
--- m4/math_h.m4        2007-10-29 02:53:01.000000000 +0100
***************
*** 1,4 ****
! # math_h.m4 serial 6
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
--- 1,4 ----
! # math_h.m4 serial 7
  dnl Copyright (C) 2007 Free Software Foundation, Inc.
  dnl This file is free software; the Free Software Foundation
  dnl gives unlimited permission to copy and/or distribute it,
***************
*** 19,65 ****
  
  AC_DEFUN([gl_MATH_H_DEFAULTS],
  [
!   GNULIB_CEILF=0;   AC_SUBST([GNULIB_CEILF])
!   GNULIB_CEILL=0;   AC_SUBST([GNULIB_CEILL])
!   GNULIB_FLOORF=0;  AC_SUBST([GNULIB_FLOORF])
!   GNULIB_FLOORL=0;  AC_SUBST([GNULIB_FLOORL])
!   GNULIB_FREXP=0;   AC_SUBST([GNULIB_FREXP])
!   GNULIB_FREXPL=0;  AC_SUBST([GNULIB_FREXPL])
!   GNULIB_LDEXPL=0;  AC_SUBST([GNULIB_LDEXPL])
!   GNULIB_MATHL=0;   AC_SUBST([GNULIB_MATHL])
!   GNULIB_ROUND=0;   AC_SUBST([GNULIB_ROUND])
!   GNULIB_ROUNDF=0;  AC_SUBST([GNULIB_ROUNDF])
!   GNULIB_ROUNDL=0;  AC_SUBST([GNULIB_ROUNDL])
!   GNULIB_SIGNBIT=0; AC_SUBST([GNULIB_SIGNBIT])
!   GNULIB_TRUNC=0;   AC_SUBST([GNULIB_TRUNC])
!   GNULIB_TRUNCF=0;  AC_SUBST([GNULIB_TRUNCF])
!   GNULIB_TRUNCL=0;  AC_SUBST([GNULIB_TRUNCL])
    GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
    dnl Assume proper GNU behavior unless another module says otherwise.
!   HAVE_DECL_ACOSL=1;  AC_SUBST([HAVE_DECL_ACOSL])
!   HAVE_DECL_ASINL=1;  AC_SUBST([HAVE_DECL_ASINL])
!   HAVE_DECL_ATANL=1;  AC_SUBST([HAVE_DECL_ATANL])
!   HAVE_DECL_CEILF=1;  AC_SUBST([HAVE_DECL_CEILF])
!   HAVE_DECL_CEILL=1;  AC_SUBST([HAVE_DECL_CEILL])
!   HAVE_DECL_COSL=1;   AC_SUBST([HAVE_DECL_COSL])
!   HAVE_DECL_EXPL=1;   AC_SUBST([HAVE_DECL_EXPL])
!   HAVE_DECL_FLOORF=1; AC_SUBST([HAVE_DECL_FLOORF])
!   HAVE_DECL_FLOORL=1; AC_SUBST([HAVE_DECL_FLOORL])
!   HAVE_DECL_FREXPL=1; AC_SUBST([HAVE_DECL_FREXPL])
!   HAVE_DECL_LDEXPL=1; AC_SUBST([HAVE_DECL_LDEXPL])
!   HAVE_DECL_LOGL=1;   AC_SUBST([HAVE_DECL_LOGL])
!   HAVE_DECL_ROUND=1;  AC_SUBST([HAVE_DECL_ROUND])
!   HAVE_DECL_ROUNDF=1; AC_SUBST([HAVE_DECL_ROUNDF])
!   HAVE_DECL_ROUNDL=1; AC_SUBST([HAVE_DECL_ROUNDL])
!   HAVE_DECL_SINL=1;   AC_SUBST([HAVE_DECL_SINL])
!   HAVE_DECL_SQRTL=1;  AC_SUBST([HAVE_DECL_SQRTL])
!   HAVE_DECL_TANL=1;   AC_SUBST([HAVE_DECL_TANL])
!   HAVE_DECL_TRUNC=1;  AC_SUBST([HAVE_DECL_TRUNC])
!   HAVE_DECL_TRUNCF=1; AC_SUBST([HAVE_DECL_TRUNCF])
!   HAVE_DECL_TRUNCL=1; AC_SUBST([HAVE_DECL_TRUNCL])
    HAVE_DECL_ISFINITE=1; AC_SUBST([HAVE_DECL_ISFINITE])
!   REPLACE_FREXP=0;    AC_SUBST([REPLACE_FREXP])
!   REPLACE_FREXPL=0;   AC_SUBST([REPLACE_FREXPL])
!   REPLACE_LDEXPL=0;   AC_SUBST([REPLACE_LDEXPL])
!   REPLACE_SIGNBIT=0;  AC_SUBST([REPLACE_SIGNBIT])
  ])
--- 19,65 ----
  
  AC_DEFUN([gl_MATH_H_DEFAULTS],
  [
!   GNULIB_CEILF=0;    AC_SUBST([GNULIB_CEILF])
!   GNULIB_CEILL=0;    AC_SUBST([GNULIB_CEILL])
!   GNULIB_FLOORF=0;   AC_SUBST([GNULIB_FLOORF])
!   GNULIB_FLOORL=0;   AC_SUBST([GNULIB_FLOORL])
!   GNULIB_FREXP=0;    AC_SUBST([GNULIB_FREXP])
!   GNULIB_FREXPL=0;   AC_SUBST([GNULIB_FREXPL])
!   GNULIB_LDEXPL=0;   AC_SUBST([GNULIB_LDEXPL])
!   GNULIB_MATHL=0;    AC_SUBST([GNULIB_MATHL])
!   GNULIB_ROUND=0;    AC_SUBST([GNULIB_ROUND])
!   GNULIB_ROUNDF=0;   AC_SUBST([GNULIB_ROUNDF])
!   GNULIB_ROUNDL=0;   AC_SUBST([GNULIB_ROUNDL])
!   GNULIB_SIGNBIT=0;  AC_SUBST([GNULIB_SIGNBIT])
!   GNULIB_TRUNC=0;    AC_SUBST([GNULIB_TRUNC])
!   GNULIB_TRUNCF=0;   AC_SUBST([GNULIB_TRUNCF])
!   GNULIB_TRUNCL=0;   AC_SUBST([GNULIB_TRUNCL])
    GNULIB_ISFINITE=0; AC_SUBST([GNULIB_ISFINITE])
    dnl Assume proper GNU behavior unless another module says otherwise.
!   HAVE_DECL_ACOSL=1;    AC_SUBST([HAVE_DECL_ACOSL])
!   HAVE_DECL_ASINL=1;    AC_SUBST([HAVE_DECL_ASINL])
!   HAVE_DECL_ATANL=1;    AC_SUBST([HAVE_DECL_ATANL])
!   HAVE_DECL_COSL=1;     AC_SUBST([HAVE_DECL_COSL])
!   HAVE_DECL_EXPL=1;     AC_SUBST([HAVE_DECL_EXPL])
!   HAVE_DECL_FREXPL=1;   AC_SUBST([HAVE_DECL_FREXPL])
!   HAVE_DECL_LDEXPL=1;   AC_SUBST([HAVE_DECL_LDEXPL])
!   HAVE_DECL_LOGL=1;     AC_SUBST([HAVE_DECL_LOGL])
!   HAVE_DECL_ROUND=1;    AC_SUBST([HAVE_DECL_ROUND])
!   HAVE_DECL_ROUNDF=1;   AC_SUBST([HAVE_DECL_ROUNDF])
!   HAVE_DECL_ROUNDL=1;   AC_SUBST([HAVE_DECL_ROUNDL])
!   HAVE_DECL_SINL=1;     AC_SUBST([HAVE_DECL_SINL])
!   HAVE_DECL_SQRTL=1;    AC_SUBST([HAVE_DECL_SQRTL])
!   HAVE_DECL_TANL=1;     AC_SUBST([HAVE_DECL_TANL])
!   HAVE_DECL_TRUNC=1;    AC_SUBST([HAVE_DECL_TRUNC])
!   HAVE_DECL_TRUNCF=1;   AC_SUBST([HAVE_DECL_TRUNCF])
!   HAVE_DECL_TRUNCL=1;   AC_SUBST([HAVE_DECL_TRUNCL])
    HAVE_DECL_ISFINITE=1; AC_SUBST([HAVE_DECL_ISFINITE])
!   REPLACE_CEILF=0;      AC_SUBST([REPLACE_CEILF])
!   REPLACE_CEILL=0;      AC_SUBST([REPLACE_CEILL])
!   REPLACE_FLOORF=0;     AC_SUBST([REPLACE_FLOORF])
!   REPLACE_FLOORL=0;     AC_SUBST([REPLACE_FLOORL])
!   REPLACE_FREXP=0;      AC_SUBST([REPLACE_FREXP])
!   REPLACE_FREXPL=0;     AC_SUBST([REPLACE_FREXPL])
!   REPLACE_LDEXPL=0;     AC_SUBST([REPLACE_LDEXPL])
!   REPLACE_SIGNBIT=0;    AC_SUBST([REPLACE_SIGNBIT])
  ])
*** modules/math.orig   2007-10-29 03:09:44.000000000 +0100
--- modules/math        2007-10-29 02:51:59.000000000 +0100
***************
*** 41,52 ****
              -e 's|@''HAVE_DECL_ACOSL''@|$(HAVE_DECL_ACOSL)|g' \
              -e 's|@''HAVE_DECL_ASINL''@|$(HAVE_DECL_ASINL)|g' \
              -e 's|@''HAVE_DECL_ATANL''@|$(HAVE_DECL_ATANL)|g' \
-             -e 's|@''HAVE_DECL_CEILF''@|$(HAVE_DECL_CEILF)|g' \
-             -e 's|@''HAVE_DECL_CEILL''@|$(HAVE_DECL_CEILL)|g' \
              -e 's|@''HAVE_DECL_COSL''@|$(HAVE_DECL_COSL)|g' \
              -e 's|@''HAVE_DECL_EXPL''@|$(HAVE_DECL_EXPL)|g' \
-             -e 's|@''HAVE_DECL_FLOORF''@|$(HAVE_DECL_FLOORF)|g' \
-             -e 's|@''HAVE_DECL_FLOORL''@|$(HAVE_DECL_FLOORL)|g' \
              -e 's|@''HAVE_DECL_FREXPL''@|$(HAVE_DECL_FREXPL)|g' \
              -e 's|@''HAVE_DECL_LDEXPL''@|$(HAVE_DECL_LDEXPL)|g' \
              -e 's|@''HAVE_DECL_LOGL''@|$(HAVE_DECL_LOGL)|g' \
--- 41,48 ----
***************
*** 60,65 ****
--- 56,65 ----
              -e 's|@''HAVE_DECL_TRUNCF''@|$(HAVE_DECL_TRUNCF)|g' \
              -e 's|@''HAVE_DECL_TRUNCL''@|$(HAVE_DECL_TRUNCL)|g' \
              -e 's|@''HAVE_DECL_ISFINITE''@|$(HAVE_DECL_ISFINITE)|g' \
+             -e 's|@''REPLACE_CEILF''@|$(REPLACE_CEILF)|g' \
+             -e 's|@''REPLACE_CEILL''@|$(REPLACE_CEILL)|g' \
+             -e 's|@''REPLACE_FLOORF''@|$(REPLACE_FLOORF)|g' \
+             -e 's|@''REPLACE_FLOORL''@|$(REPLACE_FLOORL)|g' \
              -e 's|@''REPLACE_FREXP''@|$(REPLACE_FREXP)|g' \
              -e 's|@''REPLACE_FREXPL''@|$(REPLACE_FREXPL)|g' \
              -e 's|@''REPLACE_LDEXPL''@|$(REPLACE_LDEXPL)|g' \





reply via email to

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