From: Alexandre Oliva Date: Wed, 25 Dec 2019 06:43:22 +0000 (+0000) Subject: Define HAVE_ for math long double functions declared in vxworks headers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=85129ff10afef6c9686dd566b7e728bef7a2fdc3;p=gcc.git Define HAVE_ for math long double functions declared in vxworks headers When cross-building for vxworks, test for declarations of long double functions in math.h. We don't normally test for these functions when cross compiling, because link tests don't work, or ever really, but not defining them as available causes replacements to be defined in ways that may cause duplicate definition linker errors if the units defining both the replacement and the actual implementation are brought in because of other symbols. for libstdc++-v3/ChangeLog * crossconfig.m4 (GLIBCXX_CROSSCONFIG) [*-vxworks*]: Define long double functions as available if declared by math.h. (GLIBCXX_CHECK_MATH_DECL, GLIBCXX_CHECK_MATH_DECLS): New. * configure: Rebuild. From-SVN: r279731 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 663312da1e3..947bfd2d921 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,10 @@ +2019-12-25 Alexandre Oliva + + * crossconfig.m4 (GLIBCXX_CROSSCONFIG) [*-vxworks*]: Define + long double functions as available if declared by math.h. + (GLIBCXX_CHECK_MATH_DECL, GLIBCXX_CHECK_MATH_DECLS): New. + * configure: Rebuild. + 2019-12-20 Jonathan Wakely PR libstdc++/92927 diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure index f2d52fd05f3..d96bd1457ec 100755 --- a/libstdc++-v3/configure +++ b/libstdc++-v3/configure @@ -72927,6 +72927,1110 @@ done $as_echo "#define HAVE_TANHF 1" >>confdefs.h + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acosl declaration" >&5 +$as_echo_n "checking for acosl declaration... " >&6; } +if ${glibcxx_cv_func_acosl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))acosl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_acosl_use=yes + +else + glibcxx_cv_func_acosl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_acosl_use" >&5 +$as_echo "$glibcxx_cv_func_acosl_use" >&6; } + if test "x$glibcxx_cv_func_acosl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_ACOSL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for asinl declaration" >&5 +$as_echo_n "checking for asinl declaration... " >&6; } +if ${glibcxx_cv_func_asinl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))asinl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_asinl_use=yes + +else + glibcxx_cv_func_asinl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_asinl_use" >&5 +$as_echo "$glibcxx_cv_func_asinl_use" >&6; } + if test "x$glibcxx_cv_func_asinl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_ASINL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atan2l declaration" >&5 +$as_echo_n "checking for atan2l declaration... " >&6; } +if ${glibcxx_cv_func_atan2l_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))atan2l; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_atan2l_use=yes + +else + glibcxx_cv_func_atan2l_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_atan2l_use" >&5 +$as_echo "$glibcxx_cv_func_atan2l_use" >&6; } + if test "x$glibcxx_cv_func_atan2l_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_ATAN2L 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for atanl declaration" >&5 +$as_echo_n "checking for atanl declaration... " >&6; } +if ${glibcxx_cv_func_atanl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))atanl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_atanl_use=yes + +else + glibcxx_cv_func_atanl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_atanl_use" >&5 +$as_echo "$glibcxx_cv_func_atanl_use" >&6; } + if test "x$glibcxx_cv_func_atanl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_ATANL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceill declaration" >&5 +$as_echo_n "checking for ceill declaration... " >&6; } +if ${glibcxx_cv_func_ceill_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))ceill; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_ceill_use=yes + +else + glibcxx_cv_func_ceill_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_ceill_use" >&5 +$as_echo "$glibcxx_cv_func_ceill_use" >&6; } + if test "x$glibcxx_cv_func_ceill_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_CEILL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cosl declaration" >&5 +$as_echo_n "checking for cosl declaration... " >&6; } +if ${glibcxx_cv_func_cosl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))cosl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_cosl_use=yes + +else + glibcxx_cv_func_cosl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_cosl_use" >&5 +$as_echo "$glibcxx_cv_func_cosl_use" >&6; } + if test "x$glibcxx_cv_func_cosl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_COSL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for coshl declaration" >&5 +$as_echo_n "checking for coshl declaration... " >&6; } +if ${glibcxx_cv_func_coshl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))coshl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_coshl_use=yes + +else + glibcxx_cv_func_coshl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_coshl_use" >&5 +$as_echo "$glibcxx_cv_func_coshl_use" >&6; } + if test "x$glibcxx_cv_func_coshl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_COSHL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for expl declaration" >&5 +$as_echo_n "checking for expl declaration... " >&6; } +if ${glibcxx_cv_func_expl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))expl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_expl_use=yes + +else + glibcxx_cv_func_expl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_expl_use" >&5 +$as_echo "$glibcxx_cv_func_expl_use" >&6; } + if test "x$glibcxx_cv_func_expl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_EXPL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fabsl declaration" >&5 +$as_echo_n "checking for fabsl declaration... " >&6; } +if ${glibcxx_cv_func_fabsl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))fabsl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_fabsl_use=yes + +else + glibcxx_cv_func_fabsl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_fabsl_use" >&5 +$as_echo "$glibcxx_cv_func_fabsl_use" >&6; } + if test "x$glibcxx_cv_func_fabsl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_FABSL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for floorl declaration" >&5 +$as_echo_n "checking for floorl declaration... " >&6; } +if ${glibcxx_cv_func_floorl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))floorl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_floorl_use=yes + +else + glibcxx_cv_func_floorl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_floorl_use" >&5 +$as_echo "$glibcxx_cv_func_floorl_use" >&6; } + if test "x$glibcxx_cv_func_floorl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_FLOORL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for fmodl declaration" >&5 +$as_echo_n "checking for fmodl declaration... " >&6; } +if ${glibcxx_cv_func_fmodl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))fmodl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_fmodl_use=yes + +else + glibcxx_cv_func_fmodl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_fmodl_use" >&5 +$as_echo "$glibcxx_cv_func_fmodl_use" >&6; } + if test "x$glibcxx_cv_func_fmodl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_FMODL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for frexpl declaration" >&5 +$as_echo_n "checking for frexpl declaration... " >&6; } +if ${glibcxx_cv_func_frexpl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))frexpl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_frexpl_use=yes + +else + glibcxx_cv_func_frexpl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_frexpl_use" >&5 +$as_echo "$glibcxx_cv_func_frexpl_use" >&6; } + if test "x$glibcxx_cv_func_frexpl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_FREXPL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ldexpl declaration" >&5 +$as_echo_n "checking for ldexpl declaration... " >&6; } +if ${glibcxx_cv_func_ldexpl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))ldexpl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_ldexpl_use=yes + +else + glibcxx_cv_func_ldexpl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_ldexpl_use" >&5 +$as_echo "$glibcxx_cv_func_ldexpl_use" >&6; } + if test "x$glibcxx_cv_func_ldexpl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LDEXPL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for log10l declaration" >&5 +$as_echo_n "checking for log10l declaration... " >&6; } +if ${glibcxx_cv_func_log10l_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))log10l; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_log10l_use=yes + +else + glibcxx_cv_func_log10l_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_log10l_use" >&5 +$as_echo "$glibcxx_cv_func_log10l_use" >&6; } + if test "x$glibcxx_cv_func_log10l_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LOG10L 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for logl declaration" >&5 +$as_echo_n "checking for logl declaration... " >&6; } +if ${glibcxx_cv_func_logl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))logl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_logl_use=yes + +else + glibcxx_cv_func_logl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_logl_use" >&5 +$as_echo "$glibcxx_cv_func_logl_use" >&6; } + if test "x$glibcxx_cv_func_logl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LOGL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for modfl declaration" >&5 +$as_echo_n "checking for modfl declaration... " >&6; } +if ${glibcxx_cv_func_modfl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))modfl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_modfl_use=yes + +else + glibcxx_cv_func_modfl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_modfl_use" >&5 +$as_echo "$glibcxx_cv_func_modfl_use" >&6; } + if test "x$glibcxx_cv_func_modfl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_MODFL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for powl declaration" >&5 +$as_echo_n "checking for powl declaration... " >&6; } +if ${glibcxx_cv_func_powl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))powl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_powl_use=yes + +else + glibcxx_cv_func_powl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_powl_use" >&5 +$as_echo "$glibcxx_cv_func_powl_use" >&6; } + if test "x$glibcxx_cv_func_powl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_POWL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinl declaration" >&5 +$as_echo_n "checking for sinl declaration... " >&6; } +if ${glibcxx_cv_func_sinl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))sinl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_sinl_use=yes + +else + glibcxx_cv_func_sinl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_sinl_use" >&5 +$as_echo "$glibcxx_cv_func_sinl_use" >&6; } + if test "x$glibcxx_cv_func_sinl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SINL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sinhl declaration" >&5 +$as_echo_n "checking for sinhl declaration... " >&6; } +if ${glibcxx_cv_func_sinhl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))sinhl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_sinhl_use=yes + +else + glibcxx_cv_func_sinhl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_sinhl_use" >&5 +$as_echo "$glibcxx_cv_func_sinhl_use" >&6; } + if test "x$glibcxx_cv_func_sinhl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SINHL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sqrtl declaration" >&5 +$as_echo_n "checking for sqrtl declaration... " >&6; } +if ${glibcxx_cv_func_sqrtl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))sqrtl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_sqrtl_use=yes + +else + glibcxx_cv_func_sqrtl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_sqrtl_use" >&5 +$as_echo "$glibcxx_cv_func_sqrtl_use" >&6; } + if test "x$glibcxx_cv_func_sqrtl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_SQRTL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanl declaration" >&5 +$as_echo_n "checking for tanl declaration... " >&6; } +if ${glibcxx_cv_func_tanl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))tanl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_tanl_use=yes + +else + glibcxx_cv_func_tanl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_tanl_use" >&5 +$as_echo "$glibcxx_cv_func_tanl_use" >&6; } + if test "x$glibcxx_cv_func_tanl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_TANL 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for tanhl declaration" >&5 +$as_echo_n "checking for tanhl declaration... " >&6; } +if ${glibcxx_cv_func_tanhl_use+:} false; then : + $as_echo_n "(cached) " >&6 +else + + + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#ifdef HAVE_IEEEFP_H +# include +#endif + +int +main () +{ + + void (*f)(void) = (void (*)(void))tanhl; + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + glibcxx_cv_func_tanhl_use=yes + +else + glibcxx_cv_func_tanhl_use=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $glibcxx_cv_func_tanhl_use" >&5 +$as_echo "$glibcxx_cv_func_tanhl_use" >&6; } + if test "x$glibcxx_cv_func_tanhl_use" = xyes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_TANHL 1 +_ACEOF + + fi + + + ;; *) as_fn_error $? "No support for this host/target combination." "$LINENO" 5 diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4 index 5e248897943..2a0cb0475e5 100644 --- a/libstdc++-v3/crossconfig.m4 +++ b/libstdc++-v3/crossconfig.m4 @@ -291,9 +291,71 @@ case "${host}" in AC_DEFINE(HAVE_SQRTF) AC_DEFINE(HAVE_TANF) AC_DEFINE(HAVE_TANHF) + +dnl # Different versions and execution modes implement different +dnl # subsets of these functions. Instead of hard-coding, test for C +dnl # declarations in headers. The C primitives could be defined as +dnl # macros, in which case the tests might fail, and we might have to +dnl # switch to more elaborate tests. + GLIBCXX_CHECK_MATH_DECLS([ + acosl asinl atan2l atanl ceill cosl coshl expl fabsl floorl fmodl + frexpl ldexpl log10l logl modfl powl sinl sinhl sqrtl tanl tanhl]) +dnl # sincosl is the only one missing here, compared with the *l +dnl # functions in the list guarded by +dnl # long_double_math_on_this_cpu in configure.ac, right after +dnl # the expansion of the present macro. ;; *) AC_MSG_ERROR([No support for this host/target combination.]) ;; esac ]) + + +dnl +dnl Check to see if the (math function) argument passed is +dnl declared when using the c compiler +dnl +dnl Define HAVE_CARGF etc if "cargf" is declared +dnl +dnl argument 1 is name of function to check +dnl +dnl ASSUMES argument is a math function +dnl +dnl GLIBCXX_CHECK_MATH_DECL +AC_DEFUN([GLIBCXX_CHECK_MATH_DECL], [ + AC_CACHE_CHECK([for $1 declaration], + [glibcxx_cv_func_$1_use], [ + AC_LANG_SAVE + AC_LANG_C + AC_TRY_COMPILE([ +#include +#ifdef HAVE_IEEEFP_H +# include +#endif +], [ + void (*f)(void) = (void (*)(void))$1; +], [glibcxx_cv_func_$1_use=yes +], [glibcxx_cv_func_$1_use=no])]) + if test "x$glibcxx_cv_func_$1_use" = xyes; then + AC_DEFINE_UNQUOTED(AS_TR_CPP([HAVE_$1])) + fi +]) + +dnl +dnl Check to see whether multiple math functions are +dnl declared when using the c compiler +dnl +dnl Define HAVE_CARGF HAVE_POWL etc if "cargf" and "powl" +dnl are declared +dnl +dnl argument 1 is a word list naming function to check +dnl +dnl ASSUMES arguments are math functions +dnl +dnl GLIBCXX_CHECK_MATH_DECLS +AC_DEFUN([GLIBCXX_CHECK_MATH_DECLS], [ + m4_foreach_w([glibcxx_func], [$1], [ + GLIBCXX_CHECK_MATH_DECL(glibcxx_func) + ]) +])