diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2006-12-06 22:17:35 +0100 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2006-12-06 21:17:35 +0000 |
commit | 93876dc19f500ed1adbf989fe1a3f0fcd237f2f8 (patch) | |
tree | 21cbdd8976fd656e62da3824cf1ff9e53eafab20 | |
parent | c4c6d7b2774b18445187f422ce7137131c00481b (diff) | |
download | gcc-93876dc19f500ed1adbf989fe1a3f0fcd237f2f8.tar.gz |
re PR libfortran/29810 (Unsatisfied symbol "fmodl" in libgfortran shared library)
PR libfortran/29810
* intrinsics/c99_functions.c (fmodf, fmodl, floorl): New functions.
* c99_protos.h (fmodf, fmodl, floorl): New prototypes.
* configure.ac: Check for fmodf, fmod and fmodl.
* configure: Regenerate.
* config.h.in: Regenerate.
* aclocal.m4: Regenerate.
* Makefile.in: Regenerate.
From-SVN: r119598
-rw-r--r-- | libgfortran/ChangeLog | 11 | ||||
-rw-r--r-- | libgfortran/Makefile.in | 1 | ||||
-rw-r--r-- | libgfortran/aclocal.m4 | 59 | ||||
-rw-r--r-- | libgfortran/c99_protos.h | 15 | ||||
-rw-r--r-- | libgfortran/config.h.in | 9 | ||||
-rwxr-xr-x | libgfortran/configure | 242 | ||||
-rw-r--r-- | libgfortran/configure.ac | 3 | ||||
-rw-r--r-- | libgfortran/intrinsics/c99_functions.c | 50 |
8 files changed, 330 insertions, 60 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index db30a6999d2..fdd26765d2e 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,14 @@ +2006-12-06 Francois-Xavier Coudert <coudert@clipper.ens.fr> + + PR libfortran/29810 + * intrinsics/c99_functions.c (fmodf, fmodl, floorl): New functions. + * c99_protos.h (fmodf, fmodl, floorl): New prototypes. + * configure.ac: Check for fmodf, fmod and fmodl. + * configure: Regenerate. + * config.h.in: Regenerate. + * aclocal.m4: Regenerate. + * Makefile.in: Regenerate. + 2006-11-24 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/29936 diff --git a/libgfortran/Makefile.in b/libgfortran/Makefile.in index 313e5cff14b..75010a263bd 100644 --- a/libgfortran/Makefile.in +++ b/libgfortran/Makefile.in @@ -46,6 +46,7 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/../config.guess \ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/../config/lead-dot.m4 \ + $(top_srcdir)/../config/multi.m4 \ $(top_srcdir)/../config/stdint.m4 $(top_srcdir)/acinclude.m4 \ $(top_srcdir)/../config/acx.m4 \ $(top_srcdir)/../config/no-executables.m4 \ diff --git a/libgfortran/aclocal.m4 b/libgfortran/aclocal.m4 index afe428c2425..b8dca303ac0 100644 --- a/libgfortran/aclocal.m4 +++ b/libgfortran/aclocal.m4 @@ -371,64 +371,6 @@ else fi AC_SUBST([mkdir_p])]) -# Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# serial 5 - -# AM_ENABLE_MULTILIB([MAKEFILE], [REL-TO-TOP-SRCDIR]) -# --------------------------------------------------- -# Add --enable-multilib to configure. -AC_DEFUN([AM_ENABLE_MULTILIB], -[# Default to --enable-multilib -AC_ARG_ENABLE(multilib, -[ --enable-multilib build many library versions (default)], -[case "$enableval" in - yes) multilib=yes ;; - no) multilib=no ;; - *) AC_MSG_ERROR([bad value $enableval for multilib option]) ;; - esac], - [multilib=yes]) - -# We may get other options which we leave undocumented: -# --with-target-subdir, --with-multisrctop, --with-multisubdir -# See config-ml.in if you want the gory details. - -if test "$srcdir" = "."; then - if test "$with_target_subdir" != "."; then - multi_basedir="$srcdir/$with_multisrctop../$2" - else - multi_basedir="$srcdir/$with_multisrctop$2" - fi -else - multi_basedir="$srcdir/$2" -fi -AC_SUBST(multi_basedir) - -AC_OUTPUT_COMMANDS([ -# Only add multilib support code if we just rebuilt the top-level -# Makefile. -case " $CONFIG_FILES " in - *" ]m4_default([$1],Makefile)[ "*) - ac_file=]m4_default([$1],Makefile)[ . ${multi_basedir}/config-ml.in - ;; -esac], - [ -srcdir="$srcdir" -host="$host" -target="$target" -with_multisubdir="$with_multisubdir" -with_multisrctop="$with_multisrctop" -with_target_subdir="$with_target_subdir" -ac_configure_args="${multilib_arg} ${ac_configure_args}" -multi_basedir="$multi_basedir" -CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} -CC="$CC"])])dnl - # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. @@ -639,5 +581,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([../config/lead-dot.m4]) +m4_include([../config/multi.m4]) m4_include([../config/stdint.m4]) m4_include([acinclude.m4]) diff --git a/libgfortran/c99_protos.h b/libgfortran/c99_protos.h index b7c992c2480..0b27bb2973a 100644 --- a/libgfortran/c99_protos.h +++ b/libgfortran/c99_protos.h @@ -100,6 +100,21 @@ extern float fabsf(float); extern float floorf(float); #endif +#ifndef HAVE_FLOORL +#define HAVE_FLOORL 1 +extern long double floorl (long double x); +#endif + +#ifndef HAVE_FMODF +#define HAVE_FMODF 1 +extern float fmodf (float x, float y); +#endif + +#ifndef HAVE_FMODL +#define HAVE_FMODL 1 +extern long double fmodl (long double x, long double y); +#endif + #ifndef HAVE_FREXPF #define HAVE_FREXPF 1 extern float frexpf(float, int *); diff --git a/libgfortran/config.h.in b/libgfortran/config.h.in index a198d42c7bb..11f7cc6db75 100644 --- a/libgfortran/config.h.in +++ b/libgfortran/config.h.in @@ -327,6 +327,15 @@ /* libm includes floorl */ #undef HAVE_FLOORL +/* libm includes fmod */ +#undef HAVE_FMOD + +/* libm includes fmodf */ +#undef HAVE_FMODF + +/* libm includes fmodl */ +#undef HAVE_FMODL + /* Define to 1 if you have the `fork' function. */ #undef HAVE_FORK diff --git a/libgfortran/configure b/libgfortran/configure index 6b767eb1fd3..d775aec3935 100755 --- a/libgfortran/configure +++ b/libgfortran/configure @@ -1991,6 +1991,13 @@ else fi +# Even if the default multilib is not a cross compilation, +# it may be that some of the other multilibs are. +if test $cross_compiling = no && test $multilib = yes \ + && test "x${with_multisubdir}" != x ; then + cross_compiling=maybe +fi + ac_config_commands="$ac_config_commands default-1" @@ -4171,7 +4178,7 @@ test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic" case $host in *-*-irix6*) # Find out which ABI we are using. - echo '#line 4174 "configure"' > conftest.$ac_ext + echo '#line 4181 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -4561,7 +4568,7 @@ fi # Provide some information about the compiler. -echo "$as_me:4564:" \ +echo "$as_me:4571:" \ "checking for Fortran compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` { (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 @@ -14886,6 +14893,237 @@ _ACEOF fi +echo "$as_me:$LINENO: checking for fmodf in -lm" >&5 +echo $ECHO_N "checking for fmodf in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_fmodf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char fmodf (); +int +main () +{ +fmodf (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_fmodf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_fmodf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_fmodf" >&5 +echo "${ECHO_T}$ac_cv_lib_m_fmodf" >&6 +if test $ac_cv_lib_m_fmodf = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FMODF 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for fmod in -lm" >&5 +echo $ECHO_N "checking for fmod in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_fmod+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char fmod (); +int +main () +{ +fmod (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_fmod=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_fmod=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_fmod" >&5 +echo "${ECHO_T}$ac_cv_lib_m_fmod" >&6 +if test $ac_cv_lib_m_fmod = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FMOD 1 +_ACEOF + +fi + +echo "$as_me:$LINENO: checking for fmodl in -lm" >&5 +echo $ECHO_N "checking for fmodl in -lm... $ECHO_C" >&6 +if test "${ac_cv_lib_m_fmodl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lm $LIBS" +if test x$gcc_no_link = xyes; then + { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5 +echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;} + { (exit 1); exit 1; }; } +fi +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char fmodl (); +int +main () +{ +fmodl (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_m_fmodl=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_lib_m_fmodl=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_m_fmodl" >&5 +echo "${ECHO_T}$ac_cv_lib_m_fmodl" >&6 +if test $ac_cv_lib_m_fmodl = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_FMODL 1 +_ACEOF + +fi + echo "$as_me:$LINENO: checking for frexpf in -lm" >&5 echo $ECHO_N "checking for frexpf in -lm... $ECHO_C" >&6 if test "${ac_cv_lib_m_frexpf+set}" = set; then diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac index f8f1d3e93c5..23e80fda38b 100644 --- a/libgfortran/configure.ac +++ b/libgfortran/configure.ac @@ -241,6 +241,9 @@ AC_CHECK_LIB([m],[cabsl],[AC_DEFINE([HAVE_CABSL],[1],[libm includes cabsl])]) AC_CHECK_LIB([m],[floorf],[AC_DEFINE([HAVE_FLOORF],[1],[libm includes floorf])]) AC_CHECK_LIB([m],[floor],[AC_DEFINE([HAVE_FLOOR],[1],[libm includes floor])]) AC_CHECK_LIB([m],[floorl],[AC_DEFINE([HAVE_FLOORL],[1],[libm includes floorl])]) +AC_CHECK_LIB([m],[fmodf],[AC_DEFINE([HAVE_FMODF],[1],[libm includes fmodf])]) +AC_CHECK_LIB([m],[fmod],[AC_DEFINE([HAVE_FMOD],[1],[libm includes fmod])]) +AC_CHECK_LIB([m],[fmodl],[AC_DEFINE([HAVE_FMODL],[1],[libm includes fmodl])]) AC_CHECK_LIB([m],[frexpf],[AC_DEFINE([HAVE_FREXPF],[1],[libm includes frexpf])]) AC_CHECK_LIB([m],[frexp],[AC_DEFINE([HAVE_FREXP],[1],[libm includes frexp])]) AC_CHECK_LIB([m],[frexpl],[AC_DEFINE([HAVE_FREXPL],[1],[libm includes frexpl])]) diff --git a/libgfortran/intrinsics/c99_functions.c b/libgfortran/intrinsics/c99_functions.c index 86867a20b9f..765ed40aaec 100644 --- a/libgfortran/intrinsics/c99_functions.c +++ b/libgfortran/intrinsics/c99_functions.c @@ -199,6 +199,15 @@ floorf(float x) } #endif +#ifndef HAVE_FMODF +#define HAVE_FMODF 1 +float +fmodf (float x, float y) +{ + return (float) fmod (x, y); +} +#endif + #ifndef HAVE_FREXPF #define HAVE_FREXPF 1 float @@ -497,6 +506,47 @@ log10l(long double x) #endif +#ifndef HAVE_FLOORL +#define HAVE_FLOORL 1 +long double +floorl (long double x) +{ + /* Zero, possibly signed. */ + if (x == 0) + return x; + + /* Large magnitude. */ + if (x > DBL_MAX || x < (-DBL_MAX)) + return x; + + /* Small positive values. */ + if (x >= 0 && x < DBL_MIN) + return 0; + + /* Small negative values. */ + if (x < 0 && x > (-DBL_MIN)) + return -1; + + return floor (x); +} +#endif + + +#ifndef HAVE_FMODL +#define HAVE_FMODL 1 +long double +fmodl (long double x, long double y) +{ + if (y == 0.0L) + return 0.0L; + + /* Need to check that the result has the same sign as x and magnitude + less than the magnitude of y. */ + return x - floorl (x / y) * y; +} +#endif + + #if !defined(HAVE_CABSF) #define HAVE_CABSF 1 float |