2004-05-31 05:58:10 +08:00
|
|
|
|
# Process this file with autoconf to produce a configure script, like so:
|
|
|
|
|
# aclocal && autoconf && autoheader && automake
|
|
|
|
|
|
re PR libfortran/27107 (Make dependency on io/io.h broken)
PR libfortran/27107
* runtime/environ.c: Don't include io/io.h.
* runtime/string.c: Don't include io/io.h.
(compare0): Add cast to avoid warning.
* runtime/error.c: Don't include io/io.h.
(st_printf): Move to io/unix.c.
* intrinsics/flush.c: Delete, contents moved to io/intrinsics.c.
* intrinsics/fget.c: Likewise.
* intrinsics/ftell.c: Likewise.
* intrinsics/tty.c: Likewise.
* libgfortran.h (DEFAULT_RECL, notification_std,
get_unformatted_convert, IOPARM_*, st_parameter_common, unit_convert,
DEFAULT_TEMPDIR): New declarations.
* io/io.h (DEFAULT_RECL, notification_std, get_unformatted_convert,
IOPARM_*, st_parameter_common, unit_convert, DEFAULT_TEMPDIR):
Move to libgfortran.h.
* io/unix.c: Add io/unix.h content.
(st_printf): New function.
* io/intrinsics.c: New file.
* io/unix.h: Remove, contents moved into unix.c.
* libtool-version: Update library version to 3.0.0.
* configure.ac: Update library version to 0.3.
* Makefile.am (intrinsics/fget.c, intrinsics/flush.c,
intrinsics/ftell.c, intrinsics/tty.c, libgfortran.h): Remove targets.
* Makefile.in: Regenerate.
* configure: Regenerate.
From-SVN: r120869
2007-01-18 03:44:00 +08:00
|
|
|
|
AC_INIT([GNU Fortran Runtime Library], 0.3,,[libgfortran])
|
2004-05-31 05:58:10 +08:00
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
2005-12-09 21:50:11 +08:00
|
|
|
|
GCC_TOPLEV_SUBDIRS
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
|
|
|
|
# -------
|
|
|
|
|
# Options
|
|
|
|
|
# -------
|
|
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
|
|
|
|
AC_ARG_ENABLE(version-specific-runtime-libs,
|
2010-12-10 18:55:56 +08:00
|
|
|
|
AS_HELP_STRING([--enable-version-specific-runtime-libs],
|
|
|
|
|
[specify that runtime libraries should be installed in a compiler-specific directory]),
|
2004-05-31 05:58:10 +08:00
|
|
|
|
[case "$enableval" in
|
|
|
|
|
yes) version_specific_libs=yes ;;
|
|
|
|
|
no) version_specific_libs=no ;;
|
|
|
|
|
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
|
|
|
|
esac],
|
|
|
|
|
[version_specific_libs=no])
|
|
|
|
|
AC_MSG_RESULT($version_specific_libs)
|
|
|
|
|
|
2007-09-22 03:49:34 +08:00
|
|
|
|
# Build with intermodule optimisations
|
|
|
|
|
AC_MSG_CHECKING([for --enable-intermodule])
|
|
|
|
|
AC_ARG_ENABLE(intermodule,
|
2010-12-10 18:55:56 +08:00
|
|
|
|
AS_HELP_STRING([--enable-intermodule],[build the library in one step]),
|
2007-09-22 03:49:34 +08:00
|
|
|
|
[case "$enable_intermodule" in
|
|
|
|
|
yes) onestep="-onestep";;
|
|
|
|
|
*) onestep="";;
|
|
|
|
|
esac],
|
|
|
|
|
[onestep=""])
|
|
|
|
|
AC_MSG_RESULT($enable_intermodule)
|
|
|
|
|
AM_CONDITIONAL(onestep,[test x$onestep = x-onestep])
|
|
|
|
|
AC_SUBST(onestep)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
|
|
|
|
# Gets build, host, target, *_vendor, *_cpu, *_os, etc.
|
|
|
|
|
#
|
|
|
|
|
# You will slowly go insane if you do not grok the following fact: when
|
|
|
|
|
# building this library, the top-level /target/ becomes the library's /host/.
|
|
|
|
|
#
|
|
|
|
|
# configure then causes --target to default to --host, exactly like any
|
|
|
|
|
# other package using autoconf. Therefore, 'target' and 'host' will
|
|
|
|
|
# always be the same. This makes sense both for native and cross compilers
|
|
|
|
|
# just think about it for a little while. :-)
|
|
|
|
|
#
|
|
|
|
|
# Also, if this library is being configured as part of a cross compiler, the
|
|
|
|
|
# top-level configure script will pass the "real" host as $with_cross_host.
|
|
|
|
|
#
|
|
|
|
|
# Do not delete or change the following two lines. For why, see
|
|
|
|
|
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
|
|
|
|
|
AC_CANONICAL_SYSTEM
|
2011-11-10 01:17:57 +08:00
|
|
|
|
ACX_NONCANONICAL_TARGET
|
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
|
target_alias=${target_alias-$host_alias}
|
2011-11-10 01:17:57 +08:00
|
|
|
|
AC_SUBST(target_alias)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
|
|
|
|
# Sets up automake. Must come after AC_CANONICAL_SYSTEM. Each of the
|
|
|
|
|
# following is magically included in AUTOMAKE_OPTIONS in each Makefile.am.
|
2007-01-18 06:14:48 +08:00
|
|
|
|
# 1.9.6: minimum required version
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# no-define: PACKAGE and VERSION will not be #define'd in config.h (a bunch
|
|
|
|
|
# of other PACKAGE_* variables will, however, and there's nothing
|
|
|
|
|
# we can do about that; they come from AC_INIT).
|
|
|
|
|
# foreign: we don't follow the normal rules for GNU packages (no COPYING
|
|
|
|
|
# file in the top srcdir, etc, etc), so stop complaining.
|
2010-05-05 02:58:11 +08:00
|
|
|
|
# no-dist: we don't want 'dist' and related rules.
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# -Wall: turns on all automake warnings...
|
|
|
|
|
# -Wno-portability: ...except this one, since GNU make is required.
|
2010-05-05 02:58:11 +08:00
|
|
|
|
AM_INIT_AUTOMAKE([1.9.6 no-define foreign no-dist -Wall -Wno-portability])
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
|
|
|
|
AM_MAINTAINER_MODE
|
|
|
|
|
AM_ENABLE_MULTILIB(, ..)
|
|
|
|
|
|
|
|
|
|
# Handy for debugging:
|
|
|
|
|
#AC_MSG_NOTICE($build / $host / $target / $host_alias / $target_alias); sleep 5
|
|
|
|
|
|
|
|
|
|
# Are we being configured with some form of cross compiler?
|
|
|
|
|
# NB: We don't actually need to know this just now, but when, say, a test
|
|
|
|
|
# suite is included, we'll have to know.
|
|
|
|
|
if test "$build" != "$host"; then
|
|
|
|
|
LIBGFOR_IS_NATIVE=false
|
|
|
|
|
GCC_NO_EXECUTABLES
|
|
|
|
|
else
|
|
|
|
|
LIBGFOR_IS_NATIVE=true
|
|
|
|
|
fi
|
|
|
|
|
|
2011-01-28 01:34:14 +08:00
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
|
|
|
|
|
2020-01-24 19:24:25 +08:00
|
|
|
|
GCC_WITH_TOOLEXECLIBDIR
|
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# Calculate toolexeclibdir
|
|
|
|
|
# Also toolexecdir, though it's only used in toolexeclibdir
|
|
|
|
|
case ${version_specific_libs} in
|
|
|
|
|
yes)
|
|
|
|
|
# Need the gcc compiler version to know where to install libraries
|
|
|
|
|
# and header files if --enable-version-specific-runtime-libs option
|
|
|
|
|
# is selected.
|
|
|
|
|
toolexecdir='$(libdir)/gcc/$(target_alias)'
|
2005-03-22 01:46:19 +08:00
|
|
|
|
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
2004-05-31 05:58:10 +08:00
|
|
|
|
;;
|
|
|
|
|
no)
|
|
|
|
|
if test -n "$with_cross_host" &&
|
|
|
|
|
test x"$with_cross_host" != x"no"; then
|
|
|
|
|
# Install a library built with a cross compiler in tooldir, not libdir.
|
|
|
|
|
toolexecdir='$(exec_prefix)/$(target_alias)'
|
2020-01-24 19:24:25 +08:00
|
|
|
|
case ${with_toolexeclibdir} in
|
|
|
|
|
no)
|
|
|
|
|
toolexeclibdir='$(toolexecdir)/lib'
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
toolexeclibdir=${with_toolexeclibdir}
|
|
|
|
|
;;
|
|
|
|
|
esac
|
2004-05-31 05:58:10 +08:00
|
|
|
|
else
|
|
|
|
|
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
|
|
|
|
toolexeclibdir='$(libdir)'
|
|
|
|
|
fi
|
|
|
|
|
multi_os_directory=`$CC -print-multi-os-directory`
|
|
|
|
|
case $multi_os_directory in
|
|
|
|
|
.) ;; # Avoid trailing /.
|
|
|
|
|
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
|
|
|
|
esac
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_SUBST(toolexecdir)
|
|
|
|
|
AC_SUBST(toolexeclibdir)
|
|
|
|
|
|
2010-11-17 05:23:19 +08:00
|
|
|
|
# Create a spec file, so that compile/link tests don't fail
|
|
|
|
|
test -f libgfortran.spec || touch libgfortran.spec
|
|
|
|
|
|
2011-11-10 01:17:57 +08:00
|
|
|
|
AC_LANG_C
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# Check the compiler.
|
|
|
|
|
# The same as in boehm-gc and libstdc++. Have to borrow it from there.
|
|
|
|
|
# We must force CC to /not/ be precious variables; otherwise
|
|
|
|
|
# the wrong, non-multilib-adjusted value will be used in multilibs.
|
|
|
|
|
# As a side effect, we have to subst CFLAGS ourselves.
|
|
|
|
|
|
|
|
|
|
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
|
|
|
|
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
|
|
|
|
AC_PROG_CC
|
2009-07-31 03:41:13 +08:00
|
|
|
|
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
2011-11-10 01:17:57 +08:00
|
|
|
|
AC_SUBST(CFLAGS)
|
|
|
|
|
|
|
|
|
|
AM_PROG_CC_C_O
|
|
|
|
|
|
2005-11-06 05:09:13 +08:00
|
|
|
|
# Add -Wall -fno-repack-arrays -fno-underscoring if we are using GCC.
|
2021-12-07 02:57:32 +08:00
|
|
|
|
have_real_17=no
|
2004-05-31 05:58:10 +08:00
|
|
|
|
if test "x$GCC" = "xyes"; then
|
Fortran: Improve -Wmissing-include-dirs warnings [PR55534]
It turned out that enabling the -Wmissing-include-dirs for libcpp did output
too many warnings – at least as run with -B and similar options during the
GCC build and warning for internal include dirs like finclude, unlikely of
relevance to for a real-world user.
This patch now only warns for -I and -J by default but permits to get the
full warnings including libcpp ones with -Wmissing-include-dirs. It
additionally documents this in the manual.
With that change, the -Wno-missing-include-dirs could be removed
from libgfortran's configure and libgomp's testsuite always cflags.
This reverts those bits of the previous
commit r12-3722-g417ea5c02cef7f000e66d1af22b066c2c1cda047
Additionally, it turned out that all call to load_file called exit
explicitly - except for the main file via gfc_init -> gfc_new_file. The
latter also output a file not existing fatal error, such that two errors
where printed. Now exit is called in line with the other users of
load_file.
Finally, when compileing with "nonexisting/file.f90", first a warning that
"nonexisting" does not exist as include path was printed before the file
not found error was printed. Now the directory in which the physical file
is located is added silently, relying on the file-not-found diagnostic for
those.
PR fortran/55534
gcc/ChangeLog:
* doc/invoke.texi (-Wno-missing-include-dirs.): Document Fortran
behavior.
gcc/fortran/ChangeLog:
* cpp.c (gfc_cpp_register_include_paths, gfc_cpp_post_options):
Add new bool verbose_missing_dir_warn argument.
* cpp.h (gfc_cpp_post_options): Update prototype.
* f95-lang.c (gfc_init): Remove duplicated file-not found diag.
* gfortran.h (gfc_check_include_dirs): Takes bool
verbose_missing_dir_warn arg.
(gfc_new_file): Returns now void.
* options.c (gfc_post_options): Update to warn for -I and -J,
only, by default but for all when user requested.
* scanner.c (gfc_do_check_include_dir):
(gfc_do_check_include_dirs, gfc_check_include_dirs): Take bool
verbose warn arg and update to avoid printing the same message
twice or never.
(load_file): Fix indent.
(gfc_new_file): Return void and exit when load_file failed
as all other load_file users do.
libgfortran/ChangeLog:
* configure.ac (AM_FCFLAGS): Revert r12-3722 by removing
-Wno-missing-include-dirs.
* configure: Regenerate.
libgomp/ChangeLog:
* testsuite/libgomp.fortran/fortran.exp (ALWAYS_CFLAGS): Revert
r12-3722 by removing -Wno-missing-include-dirs.
* testsuite/libgomp.oacc-fortran/fortran.exp (ALWAYS_CFLAGS): Likewise.
gcc/testsuite/ChangeLog:
* gfortran.dg/include_14.f90: Add -J testcase and update dg-output.
* gfortran.dg/include_15.f90: Likewise.
* gfortran.dg/include_16.f90: Likewise.
* gfortran.dg/include_17.f90: Likewise.
* gfortran.dg/include_18.f90: Likewise.
* gfortran.dg/include_19.f90: Likewise.
2021-09-23 02:58:35 +08:00
|
|
|
|
AM_FCFLAGS="-I . -Wall -Werror -fimplicit-none -fno-repack-arrays -fno-underscoring"
|
2014-05-13 03:20:50 +08:00
|
|
|
|
## We like to use C11 and C99 routines when available. This makes
|
|
|
|
|
## sure that
|
2005-05-15 23:37:18 +08:00
|
|
|
|
## __STDC_VERSION__ is set such that libc includes make them available.
|
2014-11-13 20:05:01 +08:00
|
|
|
|
AM_CFLAGS="-std=gnu11 -Wall -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -Wextra -Wwrite-strings -Werror=implicit-function-declaration -Werror=vla"
|
2006-01-17 06:03:14 +08:00
|
|
|
|
## Compile the following tests with the same system header contents
|
|
|
|
|
## that we'll encounter when compiling our own source files.
|
2014-05-13 03:20:50 +08:00
|
|
|
|
CFLAGS="-std=gnu11 $CFLAGS"
|
2017-11-18 06:44:59 +08:00
|
|
|
|
|
2021-12-07 02:57:32 +08:00
|
|
|
|
case x$target in
|
|
|
|
|
xpowerpc64le*-linux*)
|
|
|
|
|
AC_PREPROC_IFELSE(
|
|
|
|
|
[AC_LANG_PROGRAM([[#if __SIZEOF_LONG_DOUBLE__ != 16
|
|
|
|
|
#error long double is double
|
|
|
|
|
#endif]],
|
|
|
|
|
[[(void) 0;]])],
|
2022-01-03 23:07:02 +08:00
|
|
|
|
[AM_FCFLAGS="$AM_FCFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
|
|
|
|
|
AM_CFLAGS="$AM_CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
|
|
|
|
|
CFLAGS="$CFLAGS -mabi=ibmlongdouble -mno-gnu-attribute";
|
2021-12-07 02:57:32 +08:00
|
|
|
|
have_real_17=yes])
|
|
|
|
|
;;
|
|
|
|
|
*)
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
AM_CONDITIONAL([HAVE_REAL_17], [test "x$have_real_17" != xno])
|
2021-12-12 19:59:18 +08:00
|
|
|
|
|
2017-11-18 06:44:59 +08:00
|
|
|
|
# Add CET specific flags if CET is enabled
|
|
|
|
|
GCC_CET_FLAGS(CET_FLAGS)
|
|
|
|
|
AM_FCFLAGS="$AM_FCFLAGS $CET_FLAGS"
|
|
|
|
|
AM_CFLAGS="$AM_CFLAGS $CET_FLAGS"
|
|
|
|
|
CFLAGS="$CFLAGS $CET_FLAGS"
|
|
|
|
|
|
2005-05-15 23:37:18 +08:00
|
|
|
|
AC_SUBST(AM_FCFLAGS)
|
|
|
|
|
AC_SUBST(AM_CFLAGS)
|
2007-07-05 00:20:13 +08:00
|
|
|
|
AC_SUBST(CFLAGS)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
2007-04-24 17:08:52 +08:00
|
|
|
|
# Check for symbol versioning (copied from libssp).
|
|
|
|
|
AC_MSG_CHECKING([whether symbol versioning is supported])
|
2011-03-21 20:24:17 +08:00
|
|
|
|
AC_ARG_ENABLE(symvers,
|
|
|
|
|
AS_HELP_STRING([--disable-symvers],
|
|
|
|
|
[disable symbol versioning for libgfortran]),
|
|
|
|
|
gfortran_use_symver=$enableval,
|
|
|
|
|
gfortran_use_symver=yes)
|
2012-06-01 02:51:27 +08:00
|
|
|
|
if test "x$gfortran_use_symver" != xno; then
|
2011-03-21 20:24:17 +08:00
|
|
|
|
save_LDFLAGS="$LDFLAGS"
|
|
|
|
|
LDFLAGS="$LDFLAGS -fPIC -shared -Wl,--version-script,./conftest.map"
|
|
|
|
|
cat > conftest.map <<EOF
|
2007-04-24 17:08:52 +08:00
|
|
|
|
FOO_1.0 {
|
|
|
|
|
global: *foo*; bar; local: *;
|
|
|
|
|
};
|
|
|
|
|
EOF
|
2011-03-21 20:24:17 +08:00
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=gnu],[gfortran_use_symver=no])
|
|
|
|
|
if test x$gfortran_use_symver = xno; then
|
|
|
|
|
case "$target_os" in
|
|
|
|
|
solaris2*)
|
|
|
|
|
LDFLAGS="$save_LDFLAGS"
|
|
|
|
|
LDFLAGS="$LDFLAGS -fPIC -shared -Wl,-M,./conftest.map"
|
|
|
|
|
# Sun ld cannot handle wildcards and treats all entries as undefined.
|
|
|
|
|
cat > conftest.map <<EOF
|
2010-07-02 18:12:34 +08:00
|
|
|
|
FOO_1.0 {
|
|
|
|
|
global: foo; local: *;
|
|
|
|
|
};
|
|
|
|
|
EOF
|
2011-03-21 20:24:17 +08:00
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foo;]],[[]])],[gfortran_use_symver=sun],[gfortran_use_symver=no])
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
fi
|
|
|
|
|
LDFLAGS="$save_LDFLAGS"
|
2010-07-02 18:12:34 +08:00
|
|
|
|
fi
|
2007-04-24 17:08:52 +08:00
|
|
|
|
AC_MSG_RESULT($gfortran_use_symver)
|
2010-07-02 18:12:34 +08:00
|
|
|
|
AM_CONDITIONAL(LIBGFOR_USE_SYMVER, [test "x$gfortran_use_symver" != xno])
|
|
|
|
|
AM_CONDITIONAL(LIBGFOR_USE_SYMVER_GNU, [test "x$gfortran_use_symver" = xgnu])
|
|
|
|
|
AM_CONDITIONAL(LIBGFOR_USE_SYMVER_SUN, [test "x$gfortran_use_symver" = xsun])
|
2007-04-24 17:08:52 +08:00
|
|
|
|
|
2014-11-29 01:39:15 +08:00
|
|
|
|
# For GPU offloading, not everything in libfortran can be supported.
|
|
|
|
|
# Currently, the only target that has this problem is nvptx. The
|
|
|
|
|
# following is a (partial) list of features that are unsupportable on
|
|
|
|
|
# this particular target:
|
|
|
|
|
# * Constructors
|
|
|
|
|
# * alloca
|
|
|
|
|
# * C library support for I/O, with printf as the one notable exception
|
|
|
|
|
# * C library support for other features such as signal, environment
|
|
|
|
|
# variables, time functions
|
|
|
|
|
|
2019-06-25 19:41:38 +08:00
|
|
|
|
AM_CONDITIONAL(LIBGFOR_MINIMAL, [test "x${target_cpu}" = xnvptx])
|
2014-11-29 01:39:15 +08:00
|
|
|
|
|
2020-07-26 13:20:24 +08:00
|
|
|
|
# Some compiler target support may have limited support for integer
|
|
|
|
|
# or floating point numbers – or may want to reduce the libgfortran size
|
|
|
|
|
# although they do have the support.
|
|
|
|
|
LIBGOMP_CHECKED_INT_KINDS="1 2 4 8 16"
|
|
|
|
|
LIBGOMP_CHECKED_REAL_KINDS="4 8 10 16"
|
|
|
|
|
|
|
|
|
|
AC_SUBST(LIBGOMP_CHECKED_INT_KINDS)
|
|
|
|
|
AC_SUBST(LIBGOMP_CHECKED_REAL_KINDS)
|
|
|
|
|
|
2009-04-17 18:36:21 +08:00
|
|
|
|
# Figure out whether the compiler supports "-ffunction-sections -fdata-sections",
|
|
|
|
|
# similarly to how libstdc++ does it
|
|
|
|
|
ac_test_CFLAGS="${CFLAGS+set}"
|
|
|
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
|
|
|
|
|
|
|
|
# Check for -ffunction-sections -fdata-sections
|
|
|
|
|
AC_MSG_CHECKING([for gcc that supports -ffunction-sections -fdata-sections])
|
|
|
|
|
CFLAGS='-Werror -ffunction-sections -fdata-sections'
|
2011-03-17 01:43:41 +08:00
|
|
|
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int foo;]])], [ac_fdsections=yes], [ac_fdsections=no])
|
2009-04-17 18:36:21 +08:00
|
|
|
|
if test "$ac_test_CFLAGS" = set; then
|
|
|
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
|
|
|
else
|
|
|
|
|
# this is the suspicious part
|
|
|
|
|
CFLAGS=""
|
|
|
|
|
fi
|
|
|
|
|
if test x"$ac_fdsections" = x"yes"; then
|
|
|
|
|
SECTION_FLAGS='-ffunction-sections -fdata-sections'
|
|
|
|
|
fi
|
|
|
|
|
AC_MSG_RESULT($ac_fdsections)
|
|
|
|
|
AC_SUBST(SECTION_FLAGS)
|
|
|
|
|
|
2016-12-12 21:40:21 +08:00
|
|
|
|
# Check linker hardware capability support.
|
|
|
|
|
GCC_CHECK_LINKER_HWCAP
|
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# Find other programs we need.
|
|
|
|
|
AC_CHECK_TOOL(AS, as)
|
|
|
|
|
AC_CHECK_TOOL(AR, ar)
|
|
|
|
|
AC_CHECK_TOOL(RANLIB, ranlib, ranlib-not-found-in-path-error)
|
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
|
|
|
|
|
|
# Configure libtool
|
|
|
|
|
#AC_MSG_NOTICE([====== Starting libtool configuration])
|
|
|
|
|
AC_LIBTOOL_DLOPEN
|
|
|
|
|
AM_PROG_LIBTOOL
|
2021-03-28 22:39:33 +08:00
|
|
|
|
LT_LIB_M
|
2010-12-06 08:50:04 +08:00
|
|
|
|
ACX_LT_HOST_FLAGS
|
2004-05-31 05:58:10 +08:00
|
|
|
|
AC_SUBST(enable_shared)
|
|
|
|
|
AC_SUBST(enable_static)
|
|
|
|
|
#AC_MSG_NOTICE([====== Finished libtool configuration]) ; sleep 10
|
|
|
|
|
|
|
|
|
|
# We need gfortran to compile parts of the library
|
2004-11-05 20:50:53 +08:00
|
|
|
|
#AC_PROG_FC(gfortran)
|
|
|
|
|
FC="$GFORTRAN"
|
|
|
|
|
AC_PROG_FC(gfortran)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
2005-04-08 05:06:27 +08:00
|
|
|
|
# extra LD Flags which are required for targets
|
|
|
|
|
case "${host}" in
|
|
|
|
|
*-darwin*)
|
|
|
|
|
# Darwin needs -single_module when linking libgfortran
|
|
|
|
|
extra_ldflags_libgfortran=-Wl,-single_module
|
|
|
|
|
;;
|
|
|
|
|
esac
|
|
|
|
|
AC_SUBST(extra_ldflags_libgfortran)
|
|
|
|
|
|
2007-01-19 15:12:16 +08:00
|
|
|
|
# We need a working compiler at that point, otherwise give a clear
|
|
|
|
|
# error message and bail out.
|
|
|
|
|
LIBGFOR_WORKING_GFORTRAN
|
|
|
|
|
|
2004-07-18 20:46:39 +08:00
|
|
|
|
AC_SYS_LARGEFILE
|
2011-04-13 03:27:49 +08:00
|
|
|
|
|
|
|
|
|
# Types
|
2004-05-31 05:58:10 +08:00
|
|
|
|
AC_TYPE_OFF_T
|
2011-04-13 03:27:49 +08:00
|
|
|
|
AC_TYPE_INTPTR_T
|
|
|
|
|
AC_TYPE_UINTPTR_T
|
|
|
|
|
AC_CHECK_TYPES([ptrdiff_t])
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
2011-11-10 02:25:58 +08:00
|
|
|
|
# check header files (we assume C89 is available, so don't check for that)
|
2018-08-15 06:51:36 +08:00
|
|
|
|
AC_CHECK_HEADERS_ONCE(unistd.h sys/random.h sys/time.h sys/times.h \
|
2018-09-22 02:12:59 +08:00
|
|
|
|
sys/resource.h sys/types.h sys/stat.h sys/uio.h sys/wait.h \
|
2018-08-15 06:51:36 +08:00
|
|
|
|
floatingpoint.h ieeefp.h fenv.h fptrap.h \
|
2014-11-10 08:17:16 +08:00
|
|
|
|
fpxcp.h pwd.h complex.h xlocale.h)
|
2011-11-10 02:25:58 +08:00
|
|
|
|
|
2006-01-03 02:53:27 +08:00
|
|
|
|
GCC_HEADER_STDINT(gstdint.h)
|
2004-05-31 05:58:10 +08:00
|
|
|
|
|
2011-11-10 02:25:58 +08:00
|
|
|
|
AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev])
|
flush.c: New file.
2004-12-02 Steven G. Kargl <kargls@comcast.net>
Paul Brook <paul@codesourcery.com>
libgfortran/
* intrinsics/flush.c: New file.
* intrinsics/fnum.c: ditto
* intrinsics/stat.c: ditto
* io/io.h (unit_to_fd): Add prototype.
* io/unix.c (unit_to_fd): New function.
* configure.ac: Add test for members of struct stat. Check for
sys/types.h and sys/stat.h
* Makefile.am: Add intrinsics/{flush.c,fnum.c,stat.c}
* configure.in: Regenerate.
* config.h.in: Regenerate.
* Makefile.in: Regenerate.
fortran/
* check.c (gfc_check_flush, gfc_check_fnum): New functions.
(gfc_check_fstat, gfc_check_fstat_sub): New functions.
(gfc_check_stat, gfc_check_stat_sub): New functions.
* gfortran.h (GFC_ISYM_FNUM,GFC_ISYM_FSTAT,GFC_ISYM_STAT): New symbols
* intrinsic.c (add_functions,add_subroutines): Add flush, fnum,
fstat, and stat to intrinsics symbol tables.
* intrinsic.h (gfc_check_flush, gfc_resolve_stat_sub): Add prototypes.
(gfc_resolve_fstat_sub, gfc_resolve_stat): Ditto.
* iresolve.c (gfc_resolve_fnum, gfc_resolve_fstat): New functions.
(gfc_resolve_stat, gfc_resolve_flush): New functions.
(gfc_resolve_stat_sub,gfc_resolve_fstat_sub): New functions
* trans-intrinsic.c (gfc_conv_intrinsic_function): Add new intrinsics.
Co-Authored-By: Paul Brook <paul@codesourcery.com>
From-SVN: r91609
2004-12-02 12:10:26 +08:00
|
|
|
|
|
2015-08-28 22:57:57 +08:00
|
|
|
|
case "${host}--x${with_newlib}" in
|
|
|
|
|
mips*--xyes)
|
|
|
|
|
hardwire_newlib=1;;
|
2016-08-30 03:09:57 +08:00
|
|
|
|
nvptx*--xyes)
|
|
|
|
|
hardwire_newlib=1;;
|
2015-08-28 22:57:57 +08:00
|
|
|
|
esac
|
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
|
# Check for library functions.
|
2015-08-28 22:57:57 +08:00
|
|
|
|
if test "${hardwire_newlib:-0}" -eq 1; then
|
2013-06-24 23:24:19 +08:00
|
|
|
|
# We are being configured with a cross compiler. AC_REPLACE_FUNCS
|
|
|
|
|
# may not work correctly, because the compiler may not be able to
|
|
|
|
|
# link executables.
|
|
|
|
|
AC_DEFINE(HAVE_MKSTEMP, 1, [Define if you have mkstemp.])
|
|
|
|
|
AC_DEFINE(HAVE_STRTOF, 1, [Define if you have strtof.])
|
|
|
|
|
AC_DEFINE(HAVE_SNPRINTF, 1, [Define if you have snprintf.])
|
|
|
|
|
AC_DEFINE(HAVE_VSNPRINTF, 1, [Define if you have vsnprintf.])
|
|
|
|
|
AC_DEFINE(HAVE_LOCALTIME_R, 1, [Define if you have localtime_r.])
|
|
|
|
|
AC_DEFINE(HAVE_GMTIME_R, 1, [Define if you have gmtime_r.])
|
2014-05-23 10:06:40 +08:00
|
|
|
|
AC_DEFINE(HAVE_STRNLEN, 1, [Define if you have strnlen.])
|
|
|
|
|
AC_DEFINE(HAVE_STRNDUP, 1, [Define if you have strndup.])
|
2013-11-16 01:50:28 +08:00
|
|
|
|
|
|
|
|
|
# At some point, we should differentiate between architectures
|
|
|
|
|
# like x86, which have long double versions, and alpha/powerpc/etc.,
|
|
|
|
|
# which don't. For the time being, punt.
|
|
|
|
|
if test x"long_double_math_on_this_cpu" = x"yes"; then
|
|
|
|
|
AC_DEFINE(HAVE_STRTOLD, 1, [Define if you have strtold.])
|
|
|
|
|
fi
|
2013-06-24 23:24:19 +08:00
|
|
|
|
else
|
|
|
|
|
AC_CHECK_FUNCS_ONCE(getrusage times mkstemp strtof strtold snprintf \
|
2018-08-14 04:21:50 +08:00
|
|
|
|
ftruncate chsize chdir getentropy getlogin gethostname kill link symlink \
|
2019-05-20 03:38:11 +08:00
|
|
|
|
sleep ttyname sigaction waitpid \
|
2019-05-18 02:18:04 +08:00
|
|
|
|
alarm access fork posix_spawn setmode fcntl writev \
|
acinclude.m4: Remove LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT.
* acinclude.m4: Remove LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT.
* configure.ac: Remove checks for strcasestr, execl, close,
getrlimit, readlink, getppid, powl, erfl, j0l, j1l, y0l, y1l,
tgammal, and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r227319
2015-08-29 21:17:05 +08:00
|
|
|
|
gettimeofday stat fstat lstat getpwuid vsnprintf dup \
|
2013-06-24 23:24:19 +08:00
|
|
|
|
getcwd localtime_r gmtime_r getpwuid_r ttyname_r clock_gettime \
|
acinclude.m4: Remove LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT.
* acinclude.m4: Remove LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT.
* configure.ac: Remove checks for strcasestr, execl, close,
getrlimit, readlink, getppid, powl, erfl, j0l, j1l, y0l, y1l,
tgammal, and lgammal.
* config.h.in: Regenerate.
* configure: Regenerate.
From-SVN: r227319
2015-08-29 21:17:05 +08:00
|
|
|
|
getgid getpid getuid geteuid umask getegid \
|
2015-08-24 05:50:30 +08:00
|
|
|
|
secure_getenv __secure_getenv mkostemp strnlen strndup newlocale \
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
freelocale uselocale strerror_l strtof128 strfromf128)
|
2013-06-24 23:24:19 +08:00
|
|
|
|
fi
|
2004-08-29 07:43:41 +08:00
|
|
|
|
|
2012-05-23 16:34:06 +08:00
|
|
|
|
# Check strerror_r, cannot be above as versions with two and three arguments exist
|
|
|
|
|
LIBGFOR_CHECK_STRERROR_R
|
|
|
|
|
|
re PR libfortran/16137 (Fortran compiler unable to produce executables as libfortran depends on C99 math functions)
PR libgfortran/16137
* configure.ac: Add tests for acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
scalbnf, sinf, sinhf, sqrtf, tanf and tanhf in libm.
* config.h.in: Regenerate.
* configure: Regenerate.
* instrinsics/c99_functions.c (acosf, asinf, atan2f, atanf, ceilf,
copysignf, cosf, coshf, expf, floorf, frexpf, hypotf, logf, log10f,
nextafterf, scalbnf, sinf, sinhf, sqrtf, tanf, tanhf): New stub
implementations for targets that don't support C99 float functions.
From-SVN: r85473
2004-08-03 21:28:26 +08:00
|
|
|
|
# Check for C99 (and other IEEE) math functions
|
2012-04-02 15:46:39 +08:00
|
|
|
|
GCC_CHECK_MATH_FUNC([acosf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acos])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acosl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acoshf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acosh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acoshl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asin])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atan2f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atan2])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atan2l])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atan])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cargf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([carg])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cargl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ceilf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ceil])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ceill])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([copysignf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([copysign])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([copysignl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cosf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cos])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cosl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccosf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccos])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccosl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([coshf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cosh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([coshl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccoshf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccosh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccoshl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([expf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([exp])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([expl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cexpf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cexp])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cexpl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fabsf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fabs])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fabsl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cabsf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cabs])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cabsl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([floorf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([floor])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([floorl])
|
libgfortran: Provide some further math library fallbacks [PR94694]
The following patch provides some further math library fallbacks.
fmaf can be implemented using fma if available, fma and fmal can use
x * y + z as fallback, it is not perfect, but e.g. glibc on various arches
has been using that as fallback for many years,
and copysign/copysignl/fabs/fabsl can be implemented using corresponding
__builtin_* if we make sure that gcc expands it inline instead of using
a library call (these days it is expanded inline on most targets).
2020-04-22 Jakub Jelinek <jakub@redhat.com>
PR libfortran/94694
PR libfortran/94586
* configure.ac: Add math func checks for fmaf, fma and fmal. Add
HAVE_INLINE_BUILTIN_COPYSIGN check.
* c99_protos.h (copysign, fmaf, fma, fmal): Provide fallback
prototypes.
(HAVE_COPYSIGN, HAVE_FMAF, HAVE_FMA, HAVE_FMAL): Define if not
defined and fallback version is provided.
* intrinsics/c99_functions.c (copysign, fmaf, fma, fmal): Provide
fallback implementations if possible
* configure: Regenerated.
* config.h.in: Regenerated.
* math.m4 (GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1,
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2): New.
2020-04-23 01:17:15 +08:00
|
|
|
|
GCC_CHECK_MATH_FUNC([fmaf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fma])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fmal])
|
2012-04-02 15:46:39 +08:00
|
|
|
|
GCC_CHECK_MATH_FUNC([fmodf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fmod])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fmodl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([frexpf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([frexp])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([frexpl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([hypotf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([hypot])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([hypotl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ldexpf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ldexp])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ldexpl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([logf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([log])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([logl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clogf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clog])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clogl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([log10f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([log10])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([log10l])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clog10f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clog10])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clog10l])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([nextafterf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([nextafter])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([nextafterl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([powf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([pow])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cpowf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cpow])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cpowl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([roundf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([round])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([roundl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lroundf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lround])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lroundl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([llroundf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([llround])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([llroundl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([scalbnf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([scalbn])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([scalbnl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sin])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csin])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sqrtf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sqrt])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sqrtl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csqrtf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csqrt])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csqrtl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tan])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctan])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([truncf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([trunc])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([truncl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erff])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erfcf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erfc])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erfcl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j0f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j0])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j1f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j1])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([jnf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([jn])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([jnl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y0f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y0])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y1f])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y1])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ynf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([yn])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ynl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tgamma])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tgammaf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lgamma])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lgammaf])
|
2004-06-13 01:59:30 +08:00
|
|
|
|
|
2009-09-22 18:23:06 +08:00
|
|
|
|
# Check for GFORTRAN_C99_1.1 funcs
|
2012-04-02 15:46:39 +08:00
|
|
|
|
GCC_CHECK_MATH_FUNC([cacos])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacosf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacosh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacoshf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacoshl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacosl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casin])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catan])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanh])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanhf])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanhl])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanl])
|
2009-09-22 18:23:06 +08:00
|
|
|
|
|
2021-12-12 19:59:18 +08:00
|
|
|
|
# For POWER, check the ieee128 math functions
|
|
|
|
|
|
|
|
|
|
if test "x$have_real_17" = "xyes"; then
|
2022-01-03 23:07:02 +08:00
|
|
|
|
AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_REAL_17),[1],
|
|
|
|
|
[Define to 1 if you have REAL(KIND=17)])
|
|
|
|
|
|
2021-12-12 19:59:18 +08:00
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__acoshieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__acosieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__asinhieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__asinieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__atan2ieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__atanhieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__atanieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__coshieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__cosieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__erfieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__expieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__fabsieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__jnieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__log10ieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__logieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__powieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__sinhieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__sinieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__sqrtieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__tanhieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__tanieee128])
|
|
|
|
|
LIBGFOR_CHECK_MATH_IEEE128([__ynieee128])
|
|
|
|
|
fi
|
|
|
|
|
|
2005-09-27 03:08:27 +08:00
|
|
|
|
# On AIX, clog is present in libm as __clog
|
|
|
|
|
AC_CHECK_LIB([m],[__clog],[AC_DEFINE([HAVE_CLOG],[1],[libm includes clog])])
|
|
|
|
|
|
libgfortran: Provide some further math library fallbacks [PR94694]
The following patch provides some further math library fallbacks.
fmaf can be implemented using fma if available, fma and fmal can use
x * y + z as fallback, it is not perfect, but e.g. glibc on various arches
has been using that as fallback for many years,
and copysign/copysignl/fabs/fabsl can be implemented using corresponding
__builtin_* if we make sure that gcc expands it inline instead of using
a library call (these days it is expanded inline on most targets).
2020-04-22 Jakub Jelinek <jakub@redhat.com>
PR libfortran/94694
PR libfortran/94586
* configure.ac: Add math func checks for fmaf, fma and fmal. Add
HAVE_INLINE_BUILTIN_COPYSIGN check.
* c99_protos.h (copysign, fmaf, fma, fmal): Provide fallback
prototypes.
(HAVE_COPYSIGN, HAVE_FMAF, HAVE_FMA, HAVE_FMAL): Define if not
defined and fallback version is provided.
* intrinsics/c99_functions.c (copysign, fmaf, fma, fmal): Provide
fallback implementations if possible
* configure: Regenerated.
* config.h.in: Regenerated.
* math.m4 (GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1,
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2): New.
2020-04-23 01:17:15 +08:00
|
|
|
|
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2([copysign], [double])
|
|
|
|
|
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK2([copysignl], [long double])
|
|
|
|
|
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1([fabs], [double])
|
|
|
|
|
GCC_CHECK_MATH_INLINE_BUILTIN_FALLBACK1([fabsl], [long double])
|
|
|
|
|
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
GCC_CHECK_MATH_FUNC([acosf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([acoshf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([asinhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atan2f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([atanhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cargf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ceilf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([copysignf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cosf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccosf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([coshf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ccoshf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([expf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cexpf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fabsf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cabsf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([floorf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fmaf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([fmodf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([frexpf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([hypotf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ldexpf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([logf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clogf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([log10f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([clog10f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([nextafterf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([powf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cpowf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([roundf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lroundf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([llroundf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([scalbnf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sinhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csinhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([sqrtf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([csqrtf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tanhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ctanhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([truncf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erff128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([erfcf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j0f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([j1f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([jnf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y0f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([y1f128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([ynf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([tgammaf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([lgammaf128])
|
|
|
|
|
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacosf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([cacoshf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([casinhf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanf128])
|
|
|
|
|
GCC_CHECK_MATH_FUNC([catanhf128])
|
|
|
|
|
|
2005-10-24 04:43:54 +08:00
|
|
|
|
# Check whether the system has a working stat()
|
|
|
|
|
LIBGFOR_CHECK_WORKING_STAT
|
|
|
|
|
|
2007-08-23 21:03:35 +08:00
|
|
|
|
# Check whether __mingw_snprintf() is present
|
|
|
|
|
LIBGFOR_CHECK_MINGW_SNPRINTF
|
|
|
|
|
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
have_iec_60559_libc_support=no
|
|
|
|
|
if test "x$ac_cv_func_strtof128$ac_cv_func_strfromf128" = xyesyes \
|
|
|
|
|
&& test "x$gcc_cv_math_func_sinf128$gcc_cv_math_func_cacosf128" = xyesyes; then
|
|
|
|
|
have_iec_60559_libc_support=yes
|
|
|
|
|
fi
|
|
|
|
|
|
2010-12-10 18:55:56 +08:00
|
|
|
|
# Check whether libquadmath should be used
|
|
|
|
|
AC_ARG_ENABLE(libquadmath-support,
|
|
|
|
|
AS_HELP_STRING([--disable-libquadmath-support],
|
|
|
|
|
[disable libquadmath support for Fortran]),
|
|
|
|
|
ENABLE_LIBQUADMATH_SUPPORT=$enableval,
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
if test "x$have_iec_60559_libc_support" = xyes; then
|
|
|
|
|
ENABLE_LIBQUADMATH_SUPPORT=default
|
|
|
|
|
else
|
|
|
|
|
ENABLE_LIBQUADMATH_SUPPORT=yes
|
|
|
|
|
fi)
|
2010-12-10 18:55:56 +08:00
|
|
|
|
enable_libquadmath_support=
|
|
|
|
|
if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
|
|
|
|
|
enable_libquadmath_support=no
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
elif test "${ENABLE_LIBQUADMATH_SUPPORT}" = "default" ; then
|
|
|
|
|
enable_libquadmath_support=default
|
2010-12-10 18:55:56 +08:00
|
|
|
|
fi
|
|
|
|
|
|
fortran, libgfortran: Avoid using libquadmath for glibc 2.26+
As mentioned by Joseph in PR105101, glibc 2.26 or later has on x86
(both -m32/-m64), powerpc64le, ia64 and mips support for
*f128 math/complex APIs plus strtof128 and strfromf128, and these APIs allow
us to avoid libquadmath for Fortran purposes on these architectures,
replace *q math/complex APIs, strtof128 instead of strtoflt128 and,
while strfromf128 unfortunately isn't a perfect replacement to
quadmath_snprintf, it can be made to work.
The advantage of this is that when configured against such glibcs
(2.26 is now almost 5 years old), we can avoid linking against an extra shared
library and the math support in glibc is maintained better than libquadmath.
We need both a compiler change (so that for glibc 2.26+ it uses *f128 APIs
instead of *q) and library change.
The above mentioned problem with strfromf128 is that the strfrom* functions
are severely restricted versions of snprintf. In libgfortran, we handle
!isfinite differently and just use snprintf/quadmath_snprintf for
%+-#.*{L,Q}{f,e} printing.
strfrom* doesn't allow +, -, # modifiers and it only supports .34 or
similar precision, not .* . The L/Q etc. letters are omitted.
The + is there to force + sign at the start if it is positive.
Workaround in the patch is to add the + at the start manually for
!signbit (val).
The - (left alignment instead of right) I don't understand why we need it,
when minimum field width isn't specified (for strfrom* can't be specified),
no padding is ever added anywhere I believe.
The # is to force adding . - workaround is to search for first . or e or '\0'
character, if it is '\0', just append ., if it is e, insert . before e and
memmove the rest (which is just a few bytes, e, +/- and at most a few digits)
one byte later.
The .* case is handled by creating the format string for strfrom* by
snprintf into a temporary buffer.
As requested, this patch also switches from using __float128 type in
libgfortran to _Float128 which is equivalent on all arches that support
__float128.
The change is done in a backwards compatible change, when GCC is configured
against glibc 2.26 or newer, libgfortran.so.5 itself doesn't link against
-lquadmath nor uses any libquadmath APIs, libgfortran.a doesn't use any
libquadmath APIs either. User programs and libraries when being linked
by gfortran driver are linked against -lgfortran and -lquadmath, but
the latter only in the --as-needed linker mode, which means it needs
to be around during linking and will be linked in if there are any
calls to math/complex functions with real(kind=16) or complex(kind=16)
in compilation units compiled by older versions of gcc, but if either
user code doesn't call those math/complex functions for the largest
supported kind, or the code is recompiled by gcc with this change in,
libquadmath won't be linked in.
2022-06-28 Jakub Jelinek <jakub@redhat.com>
gcc/fortran/
* gfortran.h (gfc_real_info): Add use_iec_60559 bitfield.
* trans-types.h (gfc_real16_use_iec_60559): Declare.
* trans-types.cc (gfc_real16_use_iec_60559): Define.
(gfc_init_kinds): When building powerpc64le-linux libgfortran
on glibc 2.26 to 2.31, set gfc_real16_use_iec_60559 and
use_iec_60559.
(gfc_build_real_type): Set gfc_real16_use_iec_60559 and use_iec_60559
on glibc 2.26 or later.
* trans-intrinsic.cc (gfc_build_intrinsic_lib_fndecls): Adjust
comment. Handle gfc_real16_use_iec_60559.
(gfc_get_intrinsic_lib_fndecl): Handle use_iec_60559.
libgfortran/
* configure.ac: Check for strtof128 and strfromf128.
Check for math and complex *f128 functions. Set
have_iec_60559_libc_support to yes if *f128 support is around, for
--enable-libquadmath-support default to "default" rather than yes if
have_iec_60559_libc_support is yes.
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Test
_Float128/_Complex _Float128 rather than __float128 and
_Complex float __attribute__((mode(TC))). If libquadmath support
is defaulted and have_iec_60559_libc_support is yes, define and subst
USE_IEC_60559. Remove unused LIBGFOR_BUILD_QUAD conditional.
* Makefile.am (kinds.h): Pass @USE_IEC_60559@ as an extra
mk-kinds-h.sh argument.
* mk-kinds-h.sh: Accept 4th use_iec_60559 argument. Use
_Float128/_Complex _Float128 types instead of __float128 and
_Complex float __attribute__((mode(TC))), and if use_iec_60559 is yes,
use f128 suffix instead of q and define GFC_REAL_16_USE_IEC_60559.
* kinds-override.h: Use _Float128/_Complex _Float128 types instead of
__float128 and _Complex float __attribute__((mode(TC))), if
USE_IEC_60559 is defined, use f128 suffixes instead of q and
define GFC_REAL_17_USE_IEC_60559.
* libgfortran.h: Don't include quadmath_weak.h if USE_IEC_60559 is
defined.
(GFC_REAL_16_INFINITY, GFC_REAL_16_QUIET_NAN): Define
for GFC_REAL_16_USE_IEC_60559 differently.
* caf/single.c (convert_type): Use _Float128/_Complex _Float128
instead of __float128 and _Complex float __attribute__((mode(TC))).
For HAVE_GFC_REAL_10 when HAVE_GFC_REAL_16 isn't defined use
_Complex long double instead of long double.
* ieee/issignaling_fallback.h (ieee854_float128_shape_type): Use
_Float128 instead of __float128.
(__issignalingf128): Change argument type to _Float128.
(issignaling): Use _Float128 instead of __float128 in _Generic.
* intrinsics/cshift0.c (cshift0): Use _Float128 instead of __float128
in a comment. Fix a comment typo, logn double -> long double.
* intrinsics/erfc_scaled.c (_THRESH, _M_2_SQRTPI, _INF, _ERFC, _EXP):
Use different definitions if GFC_REAL_16_USE_IEC_60559.
(_THRESH, _M_2_SQRTPI): Use GFC_REAL_17_LITERAL macro.
(_ERFC, _EXP): Use different definitions if GFC_REAL_17_USE_IEC_60559.
* intrinsics/spread_generic.c (spread, spread_scalar): Use _Float128
instead of __float128 in a comment. Fix a comment typo,
logn double -> long double.
* intrinsics/trigd.c (ENABLE_SIND, ENABLE_COSD, ENABLE_TAND): Handle
GFC_REAL_16_USE_IEC_60559.
* intrinsics/pack_generic.c (pack): Use _Float128 instead of
__float128 in a comment. Fix a comment typo, logn double ->
long double.
* intrinsics/unpack_generic.c (unpack1, unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
* io/read.c (convert_real, convert_infnan): Handle
GFC_REAL_16_USE_IEC_60559 and GFC_REAL_17_USE_IEC_60559.
* io/transfer128.c (tmp1, tmp2): Don't define if libquadmath
isn't needed.
* io/write_float.def (gfor_strfromf128): New function.
(DTOA2Q, FDTOA2Q): Define differently if
GFC_REAL_16_USE_IEC_60559 or GFC_REAL_17_USE_IEC_60559.
* m4/mtype.m4: Use different suffix if GFC_REAL_16_USE_IEC_60559
or GFC_REAL_17_USE_IEC_60559.
* config.h.in: Regenerated.
* configure: Regenerated.
* Makefile.in: Regenerated.
* generated/bessel_r16.c: Regenerated.
* generated/bessel_r17.c: Regenerated.
* generated/norm2_r16.c: Regenerated.
* generated/norm2_r17.c: Regenerated.
2022-06-28 19:05:28 +08:00
|
|
|
|
# Check whether we have a _Float128 type, depends on enable_libquadmath_support
|
|
|
|
|
# and have_iec_60559_libc_support.
|
2010-11-17 05:23:19 +08:00
|
|
|
|
LIBGFOR_CHECK_FLOAT128
|
|
|
|
|
|
2005-10-13 04:21:31 +08:00
|
|
|
|
# Check for GNU libc feenableexcept
|
|
|
|
|
AC_CHECK_LIB([m],[feenableexcept],[have_feenableexcept=yes AC_DEFINE([HAVE_FEENABLEEXCEPT],[1],[libm includes feenableexcept])])
|
|
|
|
|
|
Remove obsolete Tru64 UNIX V5.1B support
libstdc++-v3:
* configure.host: Remove osf* handling.
* config/os/osf: Remove.
* doc/xml/manual/using.xml: Remove OSF reference.
* testsuite/18_support/pthread_guard.cc: Remove alpha*-*-osf*
handling.
* testsuite/20_util/shared_ptr/thread/default_weaktoshared.cc:
Likewise.
* testsuite/20_util/shared_ptr/thread/mutex_weaktoshared.cc:
Likewise.
* testsuite/21_strings/basic_string/pthread18185.cc: Likewise.
* testsuite/21_strings/basic_string/pthread4.cc: Likewise.
* testsuite/22_locale/locale/cons/12658_thread-1.cc: Likewise.
* testsuite/22_locale/locale/cons/12658_thread-2.cc: Likewise.
* testsuite/23_containers/list/pthread1.cc: Likewise.
* testsuite/23_containers/list/pthread5.cc: Likewise.
* testsuite/23_containers/map/pthread6.cc: Likewise.
* testsuite/23_containers/vector/debug/multithreaded_swap.cc:
Likewise.
* testsuite/27_io/basic_ofstream/pthread2.cc: Likewise.
* testsuite/27_io/basic_ostringstream/pthread3.cc: Likewise.
* testsuite/30_threads/async/42819.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/async/49668.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/async/any.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/async/async.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/async/launch.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/async/sync.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/call_once/39909.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/call_once/49668.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/call_once/call_once1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable/cons/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable/members/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable/members/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable/native_handle/typesizes.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable_any/50862.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable_any/cons/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable_any/members/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/condition_variable_any/members/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/future/cons/move.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/45133.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/get.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/get2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/share.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/valid.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/wait.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/wait_for.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/future/members/wait_until.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/lock/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/lock/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/lock/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/lock_guard/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/dest/destructor_locked.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/native_handle/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/native_handle/typesizes.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/try_lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/try_lock/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/mutex/unlock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/49668.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/alloc.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/move.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/cons/move_assign.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/get_future2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke3.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke4.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/invoke5.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/reset.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/reset2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/swap.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/packaged_task/members/valid.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/promise/cons/alloc.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/promise/cons/move.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/promise/cons/move_assign.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/get_future.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/get_future2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/set_exception.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/set_exception2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/set_value.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/set_value2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/set_value3.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/promise/members/swap.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/cons/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/dest/destructor_locked.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/lock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/native_handle/typesizes.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/try_lock/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_mutex/unlock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/cons/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/dest/destructor_locked.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/lock/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/native_handle/typesizes.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_for/3.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/try_lock_until/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/recursive_timed_mutex/unlock/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/cons/move.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/45133.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/get.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/get2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/valid.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/wait.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/wait_for.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/shared_future/members/wait_until.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/this_thread/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/this_thread/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/this_thread/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/this_thread/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/49668.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/5.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/6.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/7.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/8.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/9.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/cons/moveable.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/5.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/thread/members/hardware_concurrency.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/thread/swap/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/dest/destructor_locked.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/native_handle/typesizes.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_for/3.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/try_lock_until/2.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/timed_mutex/unlock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/try_lock/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/try_lock/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/try_lock/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/try_lock/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/5.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/cons/6.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/locking/1.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/locking/2.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/locking/3.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/locking/4.cc: Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/1.cc:
Likewise.
* libstdc++-v3/testsuite/30_threads/unique_lock/modifiers/2.cc:
Likewise.
* libstdc++-v3/testsuite/ext/rope/pthread7-rope.cc: Likewise.
* libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/default_weaktoshared.cc:
Likewise.
* libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/thread/mutex_weaktoshared.cc: Likewise.
libobjc:
* configure.ac (enable_objc_gc): Remove alpha*-dec-osf* handling.
* configure: Regenerate.
* thr.c (_XOPEN_SOURCE): Define unconditionally.
libjava:
* configure.ac (alpha*-dec-osf*): Remove.
* configure: Regenerate.
* configure.host (alpha*-dec-osf*): Remove.
* gnu/java/net/natPlainDatagramSocketImplPosix.cc (setOption): Use
IPV6_MULTICAST_IF unconditionally.
* gnu/java/net/natPlainDatagramSocketImplWin32.cc (setOption):
Likewise.
* gnu/java/net/natPlainSocketImplPosix.cc
(gnu::java::net::PlainSocketImpl::accept): Use ::accept instead of
_Jv_accept.
* include/posix-signal.h [__alpha__ && __osf__]: Remove.
* include/posix.h (_POSIX_PII_SOCKET): Don't define.
(_Jv_accept): Remove.
* java/io/File.java (File._access): Rename to access.
Change callers.
(File._stat): Likewise.
* java/io/File.h: Regenerate.
* classpath/lib/java/io/File.class: Regenerate.
* java/io/natFilePosix.cc (java::io::File::_access): Rename to
access.
(java::io::File::_stat): Rename to stat.
* java/io/natFileWin32.cc: Likewise.
* testsuite/libjava.jni/jni.exp (gcj_jni_get_cxxflags_invocation):
Remove alpha*-dec-osf* handling.
* testsuite/libjava.jvmti/jvmti-interp.exp
(gcj_jni_compile_c_to_so): Likewise.
* testsuite/libjava.jvmti/jvmti.exp (gcj_jvmti_compile_cxx_to_o):
Likewise.
libitm:
* configure.tgt (*-*-osf*): Remove.
* configure: Regenerate.
libgomp:
* configure.tgt (alpha*-dec-osf*): Remove.
* config/osf/sem.h: Remove.
* config/posix/lock.c (_XOPEN_SOURCE): Define unconditionally.
libgfortran:
* configure.ac: Remove Tru64 reference.
* acinclude.m4 (LIBGFOR_GTHREAD_WEAK): Remove alpha*-dec-osf*
handling.
* configure: Regenerate.
* intrinsics/c99_functions.c [__osf__]: Remove.
libgcc:
* config.host: Remove alpha*-dec-osf5.1* handling.
* config/alpha/gthr-posix.c: Remove.
* config/alpha/libgcc-osf5.ver: Remove.
* config/alpha/osf5-unwind.h: Remove.
* config/alpha/t-osf-pthread: Remove.
* config/alpha/t-slibgcc-osf: Remove.
* config/t-crtfm (crtfastmath.o): Remove -frandom-seed.
* gthr-posix.h [!_REENTRANT && __osf__] (_REENTRANT): Don't define.
[__osf__ && _PTHREAD_USE_MANGLED_NAMES_]: Remove.
* mkmap-flat.awk: Remove osf_export handling.
gnattools:
* configure.ac: Remove alpha*-dec-osf* handling.
* configure: Regenerate.
gcc/testsuite:
* g++.dg/abi/rtti3.C: Remove alpha*-dec-osf* handling.
* g++.dg/abi/thunk4.C: Likewise.
* g++.dg/cdce3.C: Don't skip on*-dec-osf5*.
Adapt line numbers.
* g++.dg/compat/struct-layout-1_generate.c: Remove alpha*-dec-osf*
handling.
* g++.dg/cpp0x/constexpr-rom.C: Likewise.
* g++.dg/eh/spbp.C: Likewise.
* g++.dg/ext/label13.C: Likewise.
* g++.dg/guality/guality.exp: Likewise.
* g++.dg/other/anon5.C: Likewise.
* g++.dg/other/pragma-ep-1.C: Remove.
* g++.dg/warn/miss-format-1.C: Remove alpha*-dec-osf* handling.
* g++.dg/warn/pr31246.C: Likewise.
* g++.dg/warn/weak1.C: Likewise.
* g++.old-deja/g++.eh/badalloc1.C: Likewise.
* g++.old-deja/g++.ext/attrib5.C: Likewise.
* gcc.c-torture/compile/limits-declparen.c: Likewise.
* gcc.c-torture/compile/limits-pointer.c: Likewise.
* gcc.c-torture/execute/20001229-1.c: Remove __osf__ handling.
* gcc.dg/attr-weakref-1.c: Remove alpha*-dec-osf* handling.
* gcc.dg/c99-stdint-6.c: Remove alpha*-dec-osf5* handling.
* gcc.dg/c99-tgmath-1.c: Likewise.
* gcc.dg/c99-tgmath-2.c: Likewise.
* gcc.dg/c99-tgmath-3.c: Likewise.
* gcc.dg/c99-tgmath-4.c: Likewise.
* gcc.dg/compat/struct-layout-1_generate.c: Remove alpha*-dec-osf*
handling.
* gcc.dg/debug/pr49032.c: Likewise.
* gcc.dg/guality/guality.exp: Likewise.
* gcc.dg/intmax_t-1.c: Likewise.
* gcc.dg/pr48616.c: Likewise.
* gcc.dg/pragma-ep-1.c: Remove.
* gcc.dg/pragma-ep-2.c: Remove.
* gcc.dg/pragma-ep-3.c: Remove.
* gcc.dg/torture/pr47917.c: Remove alpha*-dec-osf5* handling.
* gcc.dg/tree-ssa/pr42585.c: Remove alpha*-dec-osf* handling.
* gcc.misc-tests/gcov-14.c: Likewise.
* gfortran.dg/guality/guality.exp: Likewise.
* lib/target-supports.exp (check_weak_available): Likewise.
(add_options_for_tls): Likewise.
(check_ascii_locale_available): Likewise.
* obj-c++.dg/dwarf-2.mm: Likewise.
* objc.dg/dwarf-1.m: Likewise.
* objc.dg/dwarf-2.m: Likewise.
gcc/c-family:
* c-cppbuiltin.c (c_cpp_builtins): Remove #pragma extern_prefix
handling.
* c-pragma.c (handle_pragma_extern_prefix): Remove.
(init_pragma): Don't register extern_prefix.
gcc/po:
* EXCLUDES (mips-tdump.c, mips-tfile.c): Remove.
gcc:
* config.gcc (alpha*-dec-osf5.1*): Remove.
* config.host (alpha*-dec-osf*): Remove.
* configure.ac (*-*-osf*): Remove.
(alpha*-dec-osf*): Remove.
* configure: Regenerate.
* config/alpha/host-osf.c, config/alpha/osf5.h,
config/alpha/osf5.opt, config/alpha/va_list.h, config/alpha/x-osf:
Remove.
* config/alpha/alpha.h (TARGET_LD_BUGGY_LDGP): Remove.
* config/alpha/alpha.c (struct machine_function): Update comment.
(alpha_start_function): Remove Tru64 UNIX as handling for
max_frame_size.
* config/alpha/alpha.md ("exception_receiver"): Remove
TARGET_LD_BUGGY_LDGP.
("*exception_receiver_2"): Likewise.
* except.c (finish_eh_generation): Remove Tru64 reference.
* ginclude/stdarg.h [_HIDDEN_VA_LIST]: Don't undef _VA_LIST.
* system.h (TARGET_HANDLE_PRAGMA_EXTERN_PREFIX): Poison.
* target.def (handle_pragma_extern_prefix): Remove.
* Makefile.in (mips-tfile.o-warn): Remove.
(ALL_HOST_BACKEND_OBJS): Remove mips-tfile.o, mips-tdump.o.
(mips-tfile, mips-tfile.o, mips-tdump, mips-tdump.o): Remove.
* mips-tdump.c, mips-tfile.c: Remove.
* doc/extend.texi (Symbol-Renaming Pragmas): Remove #pragma
extern_prefix.
* doc/install.texi (Binaries): Remove Tru64 UNIX reference.
(Specific, alpha*-dec-osf5.1): Note removal.
* doc/tm.texi.in (Misc, TARGET_HANDLE_PRAGMA_EXTERN_PREFIX):
Remove.
* doc/tm.texi: Regenerate.
* doc/trouble.texi (Cross-Compiler Problems): Remove.
gcc/ada:
* gcc-interface/Makefile.in (alpha*-dec-osf*): Remove.
* a-intnam-tru64.ads, mlib-tgt-specific-tru64.adb,
s-mastop-tru64.adb, s-osinte-tru64.adb, s-osinte-tru64.ads,
s-taprop-tru64.adb, s-tasinf-tru64.ads, s-taspri-tru64.ads,
system-tru64.ads: Remove.
* adaint.c (__gnat_number_of_cpus) [__alpha__ && __osf__]:
Remove.
[IS_CROSS] [!(__alpha__ && __osf__)]: Remove.
* env.c [__alpha__ && __osf__]: Remove.
* gsocket.h (_OSF_SOURCE): Remove.
(HAVE_THREAD_SAFE_GETxxxBYyyy) [__osf__]: Remove.
* init.c [__alpha__ && __osf__]: Remove.
* link.c [__osf__]: Remove.
* s-oscons-tmplt.c [__alpha__ && __osf__]: Remove.
[__osf__ && !_SS_MAXSIZE]: Remove.
* sysdep.c [__osf__]: Remove.
* terminals.c [__alpha__ && __osf__]: Remove.
[OSF1]: Remove.
* g-traceb.ads: Remove Tru64 reference.
* g-trasym.ads: Likewise.
* gnat_ugn.texi (Linking a Mixed C++ & Ada Program): Likewise.
(Summary of Run-Time Configurations): Likewise.
* memtrack.adb: Likewise.
fixincludes:
* inclhack.def (alpha___extern_prefix): Remove.
(alpha___extern_prefix_standards): Remove.
(alpha___extern_prefix_sys_stat): Remove.
(alpha_bad_lval): Remove.
(alpha_pthread): Remove.
(alpha_pthread_gcc): Remove.
(alpha_pthread_init): Remove.
* fixincl.x: Regenerate.
* tests/base/pthread.h [ALPHA_PTHREAD_CHECK]: Remove.
[ALPHA_PTHREAD_GCC_CHECK]: Remove.
[ALPHA_PTHREAD_INIT_CHECK]: Remove.
* tests/base/standards.h: Remove.
* tests/base/sys/stat.h [ALPHA___EXTERN_PREFIX_SYS_STAT_CHECK]:
Remove.
* tests/base/testing.h [ALPHA___EXTERN_PREFIX_CHECK]: Remove.
[ALPHA_BAD_LVAL_CHECK]: Remove.
contrib:
* config-list.mk (LIST): Remove alpha-dec-osf5.1.
config:
* weakref.m4 (GCC_CHECK_ELF_STYLE_WEAKREF): Remove
alpha*-dec-osf*.
toplevel:
* MAINTAINERS (OS Port Maintainers): Remove osf.
* configure.ac (enable_libgomp): Remove *-*-osf*.
(with_stabs): Remove alpha*-*-osf*.
* configure: Regenerate.
From-SVN: r185240
2012-03-12 23:35:56 +08:00
|
|
|
|
# At least for glibc, clock_gettime is in librt. But don't
|
2011-04-15 12:21:19 +08:00
|
|
|
|
# pull that in if it still doesn't give us the function we want. This
|
|
|
|
|
# test is copied from libgomp, and modified to not link in -lrt as
|
|
|
|
|
# libgfortran calls clock_gettime via a weak reference if it's found
|
|
|
|
|
# in librt.
|
2014-04-24 19:03:56 +08:00
|
|
|
|
if test "$ac_cv_func_clock_gettime" = no; then
|
2011-02-01 04:52:00 +08:00
|
|
|
|
AC_CHECK_LIB(rt, clock_gettime,
|
2011-04-15 12:21:19 +08:00
|
|
|
|
[AC_DEFINE(HAVE_CLOCK_GETTIME_LIBRT, 1,
|
|
|
|
|
[Define to 1 if you have the `clock_gettime' function in librt.])])
|
2011-02-01 04:52:00 +08:00
|
|
|
|
fi
|
|
|
|
|
|
2005-10-29 04:13:20 +08:00
|
|
|
|
# Check for SysV fpsetmask
|
|
|
|
|
LIBGFOR_CHECK_FPSETMASK
|
2014-06-15 17:44:04 +08:00
|
|
|
|
AC_CHECK_TYPES([fp_except,fp_except_t], [], [], [[
|
2014-11-25 07:27:36 +08:00
|
|
|
|
#ifdef HAVE_IEEEFP_H
|
2014-06-15 17:44:04 +08:00
|
|
|
|
#include <ieeefp.h>
|
2014-11-25 07:27:36 +08:00
|
|
|
|
#endif
|
2014-06-15 17:44:04 +08:00
|
|
|
|
#include <math.h>
|
|
|
|
|
]])
|
|
|
|
|
AC_CHECK_TYPES([fp_rnd,fp_rnd_t], [], [], [[
|
2014-11-25 07:27:36 +08:00
|
|
|
|
#ifdef HAVE_IEEEFP_H
|
2014-06-15 17:44:04 +08:00
|
|
|
|
#include <ieeefp.h>
|
2014-11-25 07:27:36 +08:00
|
|
|
|
#endif
|
2014-06-15 17:44:04 +08:00
|
|
|
|
#include <math.h>
|
|
|
|
|
]])
|
2005-10-29 04:13:20 +08:00
|
|
|
|
|
re PR fortran/29383 (Fortran 2003/F95[TR15580:1999]: Floating point exception (IEEE) support)
PR fortran/29383
gcc/fortran/
* gfortran.h (gfc_simplify_ieee_selected_real_kind): New prototype.
* libgfortran.h (GFC_FPE_*): Use simple integer values, valid in
both C and Fortran.
* expr.c (gfc_check_init_expr): Simplify IEEE_SELECTED_REAL_KIND.
* simplify.c (gfc_simplify_ieee_selected_real_kind): New function.
* module.c (mio_symbol): Keep track of symbols which came from
intrinsic modules.
(gfc_use_module): Keep track of the IEEE modules.
* trans-decl.c (gfc_get_symbol_decl): Adjust code since
we have new intrinsic modules.
(gfc_build_builtin_function_decls): Build decls for
ieee_procedure_entry and ieee_procedure_exit.
(is_from_ieee_module, is_ieee_module_used, save_fp_state,
restore_fp_state): New functions.
(gfc_generate_function_code): Save and restore floating-point
state on procedure entry/exit, when IEEE modules are used.
* intrinsic.texi: Document the IEEE modules.
libgfortran/
* configure.host: Add checks for IEEE support, rework priorities.
* configure.ac: Define IEEE_SUPPORT, check for fpsetsticky and
fpresetsticky.
* configure: Regenerate.
* Makefile.am: Build new ieee files, install IEEE_* modules.
* Makefile.in: Regenerate.
* gfortran.map (GFORTRAN_1.6): Add new symbols.
* libgfortran.h (get_fpu_trap_exceptions, set_fpu_trap_exceptions,
support_fpu_trap, set_fpu_except_flags, support_fpu_flag,
support_fpu_rounding_mode, get_fpu_state, set_fpu_state): New
prototypes.
* config/fpu-*.h (get_fpu_trap_exceptions,
set_fpu_trap_exceptions, support_fpu_trap, set_fpu_except_flags,
support_fpu_flag, support_fpu_rounding_mode, get_fpu_state,
set_fpu_state): New functions.
* ieee/ieee_features.F90: New file.
* ieee/ieee_exceptions.F90: New file.
* ieee/ieee_arithmetic.F90: New file.
* ieee/ieee_helper.c: New file.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_fortran_ieee):
New function.
* gfortran.dg/ieee/ieee.exp: New file.
* gfortran.dg/ieee/ieee_1.F90: New file.
* gfortran.dg/ieee/ieee_2.f90: New file.
* gfortran.dg/ieee/ieee_3.f90: New file.
* gfortran.dg/ieee/ieee_4.f90: New file.
* gfortran.dg/ieee/ieee_5.f90: New file.
* gfortran.dg/ieee/ieee_6.f90: New file.
* gfortran.dg/ieee/ieee_7.f90: New file.
* gfortran.dg/ieee/ieee_rounding_1.f90: New file.
From-SVN: r212102
2014-06-28 22:17:41 +08:00
|
|
|
|
# Check whether we have fpsetsticky or fpresetsticky
|
|
|
|
|
AC_CHECK_FUNC([fpsetsticky],[have_fpsetsticky=yes AC_DEFINE([HAVE_FPSETSTICKY],[1],[fpsetsticky is present])])
|
|
|
|
|
AC_CHECK_FUNC([fpresetsticky],[have_fpresetsticky=yes AC_DEFINE([HAVE_FPRESETSTICKY],[1],[fpresetsticky is present])])
|
|
|
|
|
|
2005-10-29 04:13:20 +08:00
|
|
|
|
# Check for AIX fp_trap and fp_enable
|
|
|
|
|
AC_CHECK_FUNC([fp_trap],[have_fp_trap=yes AC_DEFINE([HAVE_FP_TRAP],[1],[fp_trap is present])])
|
|
|
|
|
AC_CHECK_FUNC([fp_enable],[have_fp_enable=yes AC_DEFINE([HAVE_FP_ENABLE],[1],[fp_enable is present])])
|
|
|
|
|
|
2017-01-20 05:00:53 +08:00
|
|
|
|
# Check if _SOFT_FLOAT is defined
|
|
|
|
|
AC_CHECK_DEFINE([_SOFT_FLOAT],[have_soft_float=yes])
|
|
|
|
|
|
2005-10-13 04:21:31 +08:00
|
|
|
|
# Runs configure.host to set up necessary host-dependent shell variables.
|
|
|
|
|
# We then display a message about it, and propagate them through the
|
|
|
|
|
# build chain.
|
|
|
|
|
. ${srcdir}/configure.host
|
|
|
|
|
AC_MSG_NOTICE([FPU dependent file will be ${fpu_host}.h])
|
re PR fortran/29383 (Fortran 2003/F95[TR15580:1999]: Floating point exception (IEEE) support)
PR fortran/29383
gcc/fortran/
* gfortran.h (gfc_simplify_ieee_selected_real_kind): New prototype.
* libgfortran.h (GFC_FPE_*): Use simple integer values, valid in
both C and Fortran.
* expr.c (gfc_check_init_expr): Simplify IEEE_SELECTED_REAL_KIND.
* simplify.c (gfc_simplify_ieee_selected_real_kind): New function.
* module.c (mio_symbol): Keep track of symbols which came from
intrinsic modules.
(gfc_use_module): Keep track of the IEEE modules.
* trans-decl.c (gfc_get_symbol_decl): Adjust code since
we have new intrinsic modules.
(gfc_build_builtin_function_decls): Build decls for
ieee_procedure_entry and ieee_procedure_exit.
(is_from_ieee_module, is_ieee_module_used, save_fp_state,
restore_fp_state): New functions.
(gfc_generate_function_code): Save and restore floating-point
state on procedure entry/exit, when IEEE modules are used.
* intrinsic.texi: Document the IEEE modules.
libgfortran/
* configure.host: Add checks for IEEE support, rework priorities.
* configure.ac: Define IEEE_SUPPORT, check for fpsetsticky and
fpresetsticky.
* configure: Regenerate.
* Makefile.am: Build new ieee files, install IEEE_* modules.
* Makefile.in: Regenerate.
* gfortran.map (GFORTRAN_1.6): Add new symbols.
* libgfortran.h (get_fpu_trap_exceptions, set_fpu_trap_exceptions,
support_fpu_trap, set_fpu_except_flags, support_fpu_flag,
support_fpu_rounding_mode, get_fpu_state, set_fpu_state): New
prototypes.
* config/fpu-*.h (get_fpu_trap_exceptions,
set_fpu_trap_exceptions, support_fpu_trap, set_fpu_except_flags,
support_fpu_flag, support_fpu_rounding_mode, get_fpu_state,
set_fpu_state): New functions.
* ieee/ieee_features.F90: New file.
* ieee/ieee_exceptions.F90: New file.
* ieee/ieee_arithmetic.F90: New file.
* ieee/ieee_helper.c: New file.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_fortran_ieee):
New function.
* gfortran.dg/ieee/ieee.exp: New file.
* gfortran.dg/ieee/ieee_1.F90: New file.
* gfortran.dg/ieee/ieee_2.f90: New file.
* gfortran.dg/ieee/ieee_3.f90: New file.
* gfortran.dg/ieee/ieee_4.f90: New file.
* gfortran.dg/ieee/ieee_5.f90: New file.
* gfortran.dg/ieee/ieee_6.f90: New file.
* gfortran.dg/ieee/ieee_7.f90: New file.
* gfortran.dg/ieee/ieee_rounding_1.f90: New file.
From-SVN: r212102
2014-06-28 22:17:41 +08:00
|
|
|
|
AC_MSG_NOTICE([Support for IEEE modules: ${ieee_support}])
|
2005-10-13 04:21:31 +08:00
|
|
|
|
FPU_HOST_HEADER=config/${fpu_host}.h
|
|
|
|
|
AC_SUBST(FPU_HOST_HEADER)
|
|
|
|
|
|
re PR fortran/29383 (Fortran 2003/F95[TR15580:1999]: Floating point exception (IEEE) support)
PR fortran/29383
gcc/fortran/
* gfortran.h (gfc_simplify_ieee_selected_real_kind): New prototype.
* libgfortran.h (GFC_FPE_*): Use simple integer values, valid in
both C and Fortran.
* expr.c (gfc_check_init_expr): Simplify IEEE_SELECTED_REAL_KIND.
* simplify.c (gfc_simplify_ieee_selected_real_kind): New function.
* module.c (mio_symbol): Keep track of symbols which came from
intrinsic modules.
(gfc_use_module): Keep track of the IEEE modules.
* trans-decl.c (gfc_get_symbol_decl): Adjust code since
we have new intrinsic modules.
(gfc_build_builtin_function_decls): Build decls for
ieee_procedure_entry and ieee_procedure_exit.
(is_from_ieee_module, is_ieee_module_used, save_fp_state,
restore_fp_state): New functions.
(gfc_generate_function_code): Save and restore floating-point
state on procedure entry/exit, when IEEE modules are used.
* intrinsic.texi: Document the IEEE modules.
libgfortran/
* configure.host: Add checks for IEEE support, rework priorities.
* configure.ac: Define IEEE_SUPPORT, check for fpsetsticky and
fpresetsticky.
* configure: Regenerate.
* Makefile.am: Build new ieee files, install IEEE_* modules.
* Makefile.in: Regenerate.
* gfortran.map (GFORTRAN_1.6): Add new symbols.
* libgfortran.h (get_fpu_trap_exceptions, set_fpu_trap_exceptions,
support_fpu_trap, set_fpu_except_flags, support_fpu_flag,
support_fpu_rounding_mode, get_fpu_state, set_fpu_state): New
prototypes.
* config/fpu-*.h (get_fpu_trap_exceptions,
set_fpu_trap_exceptions, support_fpu_trap, set_fpu_except_flags,
support_fpu_flag, support_fpu_rounding_mode, get_fpu_state,
set_fpu_state): New functions.
* ieee/ieee_features.F90: New file.
* ieee/ieee_exceptions.F90: New file.
* ieee/ieee_arithmetic.F90: New file.
* ieee/ieee_helper.c: New file.
gcc/testsuite/
* lib/target-supports.exp (check_effective_target_fortran_ieee):
New function.
* gfortran.dg/ieee/ieee.exp: New file.
* gfortran.dg/ieee/ieee_1.F90: New file.
* gfortran.dg/ieee/ieee_2.f90: New file.
* gfortran.dg/ieee/ieee_3.f90: New file.
* gfortran.dg/ieee/ieee_4.f90: New file.
* gfortran.dg/ieee/ieee_5.f90: New file.
* gfortran.dg/ieee/ieee_6.f90: New file.
* gfortran.dg/ieee/ieee_7.f90: New file.
* gfortran.dg/ieee/ieee_rounding_1.f90: New file.
From-SVN: r212102
2014-06-28 22:17:41 +08:00
|
|
|
|
# Whether we will build the IEEE modules
|
|
|
|
|
AM_CONDITIONAL(IEEE_SUPPORT,[test x${ieee_support} = xyes])
|
|
|
|
|
AC_SUBST(IEEE_SUPPORT)
|
|
|
|
|
|
2009-07-31 06:56:08 +08:00
|
|
|
|
# Some targets require additional compiler options for IEEE compatibility.
|
|
|
|
|
IEEE_FLAGS="${ieee_flags}"
|
|
|
|
|
AC_SUBST(IEEE_FLAGS)
|
|
|
|
|
|
2020-05-16 05:46:08 +08:00
|
|
|
|
# Conditionalize the makefile for this target machine.
|
|
|
|
|
tmake_file_=
|
|
|
|
|
for f in ${tmake_file}
|
|
|
|
|
do
|
|
|
|
|
if test -f ${srcdir}/config/$f
|
|
|
|
|
then
|
|
|
|
|
tmake_file_="${tmake_file_} \$(srcdir)/config/$f"
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
tmake_file="${tmake_file_}"
|
|
|
|
|
AC_SUBST(tmake_file)
|
|
|
|
|
|
2011-02-24 22:51:17 +08:00
|
|
|
|
|
|
|
|
|
# Check for POSIX getpwuid_r
|
|
|
|
|
#
|
|
|
|
|
# There are two versions of getpwuid_r, the POSIX one with 5
|
|
|
|
|
# arguments, and another one with 4 arguments used by at least HP-UX
|
|
|
|
|
# 10.2.
|
|
|
|
|
if test "$ac_cv_func_getpwuid_r" = "yes"; then
|
|
|
|
|
AC_CACHE_CHECK([POSIX version of getpwuid_r with 5 arguments], libgfor_cv_posix_getpwuid_r, [
|
|
|
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <pwd.h>], [
|
|
|
|
|
getpwuid_r(0, NULL, NULL, 0, NULL);
|
|
|
|
|
])], [libgfor_cv_posix_getpwuid_r="yes"], [libgfor_cv_posix_getpwuid_r="no"])])
|
|
|
|
|
fi
|
|
|
|
|
if test "$libgfor_cv_posix_getpwuid_r" = "yes"; then
|
|
|
|
|
AC_DEFINE([HAVE_POSIX_GETPWUID_R], [1], [Define to 1 if we have POSIX getpwuid_r which takes 5 arguments.])
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
* acinclude.m4 (LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY): New.
(LIBGFOR_CHECK_ATTRIBUTE_DLLEXPORT): New.
(LIBGFOR_CHECK_ATTRIBUTE_ALIAS): New.
* configure.ac: Use them.
* configure, config.h.in, aclocal.m4: Rebuild.
* libgfortran.h (prefix): Remove.
(PREFIX, IPREFIX): New.
(sym_rename, sym_rename1, sym_rename2): New.
(internal_proto, export_proto, export_proto_np): New.
(iexport_proto, iexport): New.
(iexport_data_proto, iexport_data): New.
* intrinsics/abort.c, intrinsics/args.c, intrinsics/associated.c,
intrinsics/cpu_time.c, intrinsics/cshift0.c,
intrinsics/date_and_time.c, intrinsics/env.c, intrinsics/eoshift0.c,
intrinsics/eoshift2.c, intrinsics/etime.c, intrinsics/exit.c,
intrinsics/flush.c, intrinsics/fnum.c, intrinsics/getXid.c,
intrinsics/getcwd.c, intrinsics/ishftc.c, intrinsics/mvbits.c,
intrinsics/pack_generic.c, intrinsics/rand.c, intrinsics/random.c,
intrinsics/reshape_generic.c, intrinsics/size.c,
intrinsics/spread_generic.c, intrinsics/stat.c,
intrinsics/string_intrinsics.c, intrinsics/system.c,
intrinsics/system_clock.c, intrinsics/transpose_generic.c,
intrinsics/umask.c, intrinsics/unlink.c, intrinsics/unpack_generic.c,
io/backspace.c, io/close.c, io/endfile.c, io/inquire.c, io/io.h,
io/open.c, io/rewind.c, io/transfer.c, libgfortran.h, m4/cshift1.m4,
m4/dotprod.m4, m4/dotprodc.m4, m4/dotprodl.m4, m4/eoshift1.m4,
m4/eoshift3.m4, m4/exponent.m4, m4/fraction.m4, m4/iforeach.m4,
m4/ifunction.m4, m4/matmul.m4, m4/matmull.m4, m4/nearest.m4,
m4/pow.m4, m4/reshape.m4, m4/set_exponent.m4, m4/shape.m4,
m4/transpose.m4, runtime/environ.c, runtime/error.c,
runtime/in_pack_generic.c, runtime/in_unpack_generic.c,
runtime/main.c, runtime/memory.c, runtime/pause.c, runtime/select.c,
runtime/stop.c: Use them to mark symbols internal or external.
* generated/*: Rebuild.
From-SVN: r92045
2004-12-12 16:59:05 +08:00
|
|
|
|
# Check out attribute support.
|
|
|
|
|
LIBGFOR_CHECK_ATTRIBUTE_VISIBILITY
|
|
|
|
|
LIBGFOR_CHECK_ATTRIBUTE_ALIAS
|
|
|
|
|
|
2018-11-22 15:58:29 +08:00
|
|
|
|
# Check out atomic builtins support.
|
|
|
|
|
LIBGFOR_CHECK_ATOMIC_FETCH_ADD
|
re PR fortran/14943 (read/write code generation is not thread safe)
gcc/fortran/
PR fortran/14943
PR fortran/21647
* Make-lang.in (fortran/trans-io.o): Depend on fortran/ioparm.def.
* dump-parse-tree.c (gfc_show_code_node): Dump c->block for
EXEC_{READ,WRITE,IOLENGTH} nodes.
* io.c (terminate_io, match_io, gfc_match_inquire): Put data
transfer commands into EXEC_{READ,WRITE,IOLENGTH}'s code->block.
* resolve.c (resolve_blocks): Handle EXEC_{READ,WRITE,IOLENGTH}.
* trans-io.c (ioparm_unit, ioparm_err, ioparm_end, ioparm_eor,
ioparm_list_format, ioparm_library_return, ioparm_iostat,
ioparm_exist, ioparm_opened, ioparm_number, ioparm_named,
ioparm_rec, ioparm_nextrec, ioparm_size, ioparm_recl_in,
ioparm_recl_out, ioparm_iolength, ioparm_file, ioparm_file_len,
ioparm_status, ioparm_status_len, ioparm_access, ioparm_access_len,
ioparm_form, ioparm_form_len, ioparm_blank, ioparm_blank_len,
ioparm_position, ioparm_position_len, ioparm_action,
ioparm_action_len, ioparm_delim, ioparm_delim_len, ioparm_pad,
ioparm_pad_len, ioparm_format, ioparm_format_len, ioparm_advance,
ioparm_advance_len, ioparm_name, ioparm_name_len,
ioparm_internal_unit, ioparm_internal_unit_len,
ioparm_internal_unit_desc, ioparm_sequential, ioparm_sequential_len,
ioparm_direct, ioparm_direct_len, ioparm_formatted,
ioparm_formatted_len, ioparm_unformatted, ioparm_unformatted_len,
ioparm_read, ioparm_read_len, ioparm_write, ioparm_write_len,
ioparm_readwrite, ioparm_readwrite_len, ioparm_namelist_name,
ioparm_namelist_name_len, ioparm_namelist_read_mode, ioparm_iomsg,
ioparm_iomsg_len, ioparm_var): Remove.
(enum ioparam_type, enum iofield_type, enum iofield,
enum iocall): New enums.
(gfc_st_parameter_field, gfc_st_parameter): New typedefs.
(st_parameter, st_parameter_field, iocall): New variables.
(ADD_FIELD, ADD_STRING): Remove.
(dt_parm, dt_post_end_block): New variables.
(gfc_build_st_parameter): New function.
(gfc_build_io_library_fndecls): Use it. Initialize iocall
array rather than ioparm_*, add extra first arguments to
the function types.
(set_parameter_const): New function.
(set_parameter_value): Add type argument, return a bitmask.
Changed to set a field in automatic structure variable rather
than set a field in a global _gfortran_ioparm variable.
(set_parameter_ref): Likewise. If requested var has different
size than what field should point to, call with a temporary and
then copy into the user variable. Add postblock argument.
(set_string): Remove var_len argument, add type argument, return
a bitmask. Changed to set fields in automatic structure variable
rather than set a field in a global _gfortran_ioparm variable.
(set_internal_unit): Remove iunit, iunit_len, iunit_desc arguments,
add var argument. Return a bitmask. Changed to set fields in
automatic structure variable rather than set a field in a global
_gfortran_ioparm variable.
(set_flag): Removed.
(io_result): Add var argument. Changed to read common.flags field
from automatic structure variable and bitwise AND it with 3.
(set_error_locus): Add var argument. Changed to set fields in
automatic structure variable rather than set a field in a global
_gfortran_{filename,line} variables.
(gfc_trans_open): Use gfc_start_block rather than gfc_init_block.
Create a temporary st_parameter_* structure. Adjust callers of
all above mentioned functions. Pass address of the temporary
variable as first argument to the generated function call.
Use iocall array rather than ioparm_* separate variables.
(gfc_trans_close, build_filepos, gfc_trans_inquire): Likewise.
(build_dt): Likewise. Change first argument to tree from tree *.
Don't dereference code->ext.dt if last_dt == INQUIRE. Emit
IOLENGTH argument setup here. Set dt_parm/dt_post_end_block
variables and gfc_trans_code the nested data transfer commands
in code->block.
(gfc_trans_iolength): Just set last_dt and call build_dt immediately.
(transfer_namelist_element): Pass address of dt_parm variable
to generated functions. Use iocall array rather than ioparm_*
separate variables.
(gfc_trans_backspace, gfc_trans_endfile, gfc_trans_rewind,
gfc_trans_flush, gfc_trans_read, gfc_trans_write): Use iocall array
rather than ioparm_* separate variables.
(gfc_trans_dt_end): Likewise. Pass address of dt_parm variable
as first argument to generated function. Adjust io_result caller.
Prepend dt_post_end_block before io_result code.
(transfer_expr): Use iocall array rather than ioparm_* separate
variables. Pass address of dt_parm variables as first argument
to generated functions.
* ioparm.def: New file.
gcc/testsuite/
PR fortran/24774
* gfortran.dg/inquire_9.f90: New test.
PR fortran/21647
* gfortran.fortran-torture/execute/inquire_5.f90: New test.
libgfortran/
PR fortran/24774
PR fortran/14943
PR fortran/21647
* Makefile.am (AM_CPPFLAGS): Add gcc directories as -I paths,
add -D_GNU_SOURCE.
* Makefile.in: Regenerated.
* acinclude.m4 (LIBGFOR_CHECK_SYNC_FETCH_AND_ADD,
LIBGFOR_CHECK_GTHR_DEFAULT, LIBGFOR_CHECK_PRAGMA_WEAK): New macros.
* configure.ac: Add them.
* configure: Rebuilt.
* config.h.in: Rebuilt.
* libtool-version: Bump libgfortran.so SONAME to libgfortran.so.1.
* libgfortran.h (library_start, show_locus, internal_error,
generate_error, find_option): Add st_parameter_common * argument.
(library_end): Change into a dummy macro.
* io/io.h: Include gthr.h.
(SUPPORTS_WEAK): Define if HAVE_PRAGMA_WEAK.
(CHARACTER): Remove define.
(st_parameter, global_t): Remove typedef.
(ioparm, g, ionml, current_unit): Remove variables.
(init_error_stream): Remove prototype.
(CHARACTER1, CHARACTER2): Define.
(st_parameter_common, st_parameter_open, st_parameter_close,
st_parameter_filepos, st_parameter_inquire, st_parameter_dt): New
typedefs.
(IOPARM_LIBRETURN_MASK, IOPARM_LIBRETURN_OK, IOPARM_LIBRETURN_ERROR,
IOPARM_LIBRETURN_END, IOPARM_LIBRETURN_EOR, IOPARM_ERR, IOPARM_END,
IOPARM_EOR, IOPARM_HAS_IOSTAT, IOPARM_HAS_IOMSG, IOPARM_COMMON_MASK,
IOPARM_OPEN_HAS_RECL_IN, IOPARM_OPEN_HAS_FILE, IOPARM_OPEN_HAS_STATUS,
IOPARM_OPEN_HAS_ACCESS, IOPARM_OPEN_HAS_FORM, IOPARM_OPEN_HAS_BLANK,
IOPARM_OPEN_HAS_POSITION, IOPARM_OPEN_HAS_ACTION,
IOPARM_OPEN_HAS_DELIM, IOPARM_OPEN_HAS_PAD, IOPARM_CLOSE_HAS_STATUS,
IOPARM_INQUIRE_HAS_EXIST, IOPARM_INQUIRE_HAS_OPENED,
IOPARM_INQUIRE_HAS_NUMBER, IOPARM_INQUIRE_HAS_NAMED,
IOPARM_INQUIRE_HAS_NEXTREC, IOPARM_INQUIRE_HAS_RECL_OUT,
IOPARM_INQUIRE_HAS_FILE, IOPARM_INQUIRE_HAS_ACCESS,
IOPARM_INQUIRE_HAS_FORM, IOPARM_INQUIRE_HAS_BLANK,
IOPARM_INQUIRE_HAS_POSITION, IOPARM_INQUIRE_HAS_ACTION,
IOPARM_INQUIRE_HAS_DELIM, IOPARM_INQUIRE_HAS_PAD,
IOPARM_INQUIRE_HAS_NAME, IOPARM_INQUIRE_HAS_SEQUENTIAL,
IOPARM_INQUIRE_HAS_DIRECT, IOPARM_INQUIRE_HAS_FORMATTED,
IOPARM_INQUIRE_HAS_UNFORMATTED, IOPARM_INQUIRE_HAS_READ,
IOPARM_INQUIRE_HAS_WRITE, IOPARM_INQUIRE_HAS_READWRITE,
IOPARM_DT_LIST_FORMAT, IOPARM_DT_NAMELIST_READ_MODE,
IOPARM_DT_HAS_REC, IOPARM_DT_HAS_SIZE, IOPARM_DT_HAS_IOLENGTH,
IOPARM_DT_HAS_FORMAT, IOPARM_DT_HAS_ADVANCE,
IOPARM_DT_HAS_INTERNAL_UNIT, IOPARM_DT_HAS_NAMELIST_NAME,
IOPARM_DT_IONML_SET): Define.
(gfc_unit): Add lock, waiting and close fields. Change file
from flexible array member into pointer to char.
(open_external): Add st_parameter_open * argument.
(find_file, file_exists): Add file and file_len arguments.
(flush_all_units): New prototype.
(max_offset, unit_root, unit_lock): New variable.
(is_internal_unit, is_array_io, next_array_record,
parse_format, next_format, unget_format, format_error,
read_block, write_block, next_record, convert_real,
read_a, read_f, read_l, read_x, read_radix, read_decimal,
list_formatted_read, finish_list_read, namelist_read,
namelist_write, write_a, write_b, write_d, write_e, write_en,
write_es, write_f, write_i, write_l, write_o, write_x, write_z,
list_formatted_write, get_unit): Add st_parameter_dt * argument.
(insert_unit): Remove prototype.
(find_or_create_unit, unlock_unit): New prototype.
(new_unit): Return gfc_unit *. Add st_parameter_open *
and gfc_unit * arguments.
(free_fnodes): Remove prototype.
(free_format_data): New prototype.
(scratch): Remove.
(init_at_eol): Remove prototype.
(free_ionml): New prototype.
(inc_waiting_locked, predec_waiting_locked, dec_waiting_unlocked):
New inline functions.
* io/unit.c (max_offset, unit_root, unit_lock): New variables.
(insert): Adjust os_error caller.
(insert_unit): Made static. Allocate memory here, initialize
lock and after inserting it return it, locked.
(delete_unit): Adjust for deletion of g.
(find_unit_1): New function.
(find_unit): Use it.
(find_or_create_unit): New function.
(get_unit): Add dtp argument, change meaning of the int argument
as creation request flag. Adjust for different st_* calling
conventions, lock internal unit's lock before returning it
and removal of g. Call find_unit_1 instead of find_unit.
(is_internal_unit, is_array_io): Add dtp argument, adjust for
removal of most of global variables.
(init_units): Initialize unit_lock. Adjust insert_unit callers
and adjust for g removal.
(close_unit_1): New function.
(close_unit): Use it.
(unlock_unit): New function.
(close_units): Lock unit_lock, use close_unit_1 rather than
close_unit.
* io/close.c (st_close): Add clp argument. Adjust for new
st_* calling conventions and internal function API changes.
* io/file_pos.c (st_backspace, st_endfile, st_rewind, st_flush):
Add fpp argument. Adjust for new st_* calling conventions and
internal function API changes.
(formatted_backspace, unformatted_backspace): Likewise. Add
u argument.
* io/open.c (edit_modes, st_open): Add opp argument. Adjust for
new st_* calling conventions and internal function API changes.
(already_open): Likewise. If not HAVE_UNLINK_OPEN_FILE, unlink
scratch file. Instead of calling close_unit just call sclose,
free u->file if any and clear a few u fields before calling
new_unit.
(new_unit): Return gfc_unit *. Add opp and u arguments.
Adjust for new st_* calling conventions and internal function
API changes. Don't allocate unit here, rather than work with
already created unit u already locked on entry. In case
of failure, close_unit it.
* io/unix.c: Include unix.h.
(BUFFER_SIZE, unix_stream): Moved to unix.h.
(unit_to_fd): Add unlock_unit call.
(tempfile): Add opp argument, use its fields rather than ioparm.
(regular_file): Likewise.
(open_external): Likewise. Only unlink file if fd >= 0.
(init_error_stream): Add error argument, set structure it points
to rather than filling static variable and returning its address.
(FIND_FILE0_DECL, FIND_FILE0_ARGS): Define.
(find_file0): Use them. Don't crash if u->s == NULL.
(find_file): Add file and file_len arguments, use them instead
of ioparm. Add locking. Pass either an array of 2 struct stat
or file and file_len pair to find_file0.
(flush_all_units_1, flush_all_units): New functions.
(file_exists): Add file and file_len arguments, use them instead
of ioparm.
* io/unix.h: New file.
* io/lock.c (ioparm, g, ionml): Remove variables.
(library_start): Add cmp argument, adjust for new st_* calling
conventions.
(library_end): Remove.
(free_ionml): New function.
* io/inquire.c (inquire_via_unit, inquire_via_filename,
st_inquire): Add iqp argument, adjust for new st_* calling
conventions and internal function API changes.
* io/format.c (FARRAY_SIZE): Decrease to 64.
(fnode_array, format_data): New typedefs.
(avail, array, format_string, string, error, saved_token, value,
format_string_len, reversion_ok, saved_format): Remove variables.
(colon_node): Add const.
(free_fnode, free_fnodes): Remove.
(free_format_data): New function.
(next_char, unget_char, get_fnode, format_lex, parse_format_list,
format_error, parse_format, revert, unget_format, next_test): Add
fmt or dtp arguments, pass it all around, adjust for internal
function API changes and adjust for removal of global variables.
(next_format): Likewise. Constify return type.
(next_format0): Constify return type.
* io/transfer.c (current_unit, sf_seen_eor, eor_condition, max_pos,
skips, pending_spaces, scratch, line_buffer, advance_status,
transfer): Remove variables.
(transfer_integer, transfer_real, transfer_logical,
transfer_character, transfer_complex, transfer_array, current_mode,
read_sf, read_block, read_block_direct, write_block,
write_block_direct, unformatted_read, unformatted_write,
type_name, write_constant_string, require_type,
formatted_transfer_scalar, us_read, us_write, pre_position,
data_transfer_init, next_record_r, next_record_w, next_record,
finalize_transfer, iolength_transfer, iolength_transfer_init,
st_iolength, st_iolength_done, st_read, st_read_done, st_write,
st_write_done, st_set_nml_var, st_set_nml_var_dim,
next_array_record): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
* io/list_read.c (repeat_count, saved_length, saved_used,
input_complete, at_eol, comma_flag, last_char, saved_string,
saved_type, namelist_mode, nml_read_error, value, parse_err_msg,
nml_err_msg, prev_nl): Remove variables.
(push_char, free_saved, next_char, unget_char, eat_spaces,
eat_separator, finish_separator, nml_bad_return, convert_integer,
parse_repeat, read_logical, read_integer, read_character,
parse_real, read_complex, read_real, check_type,
list_formatted_read_scalar, list_formatted_read, finish_list_read,
find_nml_node, nml_untouch_nodes, nml_match_name, nml_query,
namelist_read): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
(nml_parse_qualifier): Likewise. Add parse_err_msg argument.
(nml_read_obj): Likewise. Add pprev_nl, nml_err_msg, clow and
chigh arguments.
(nml_get_obj_data): Likewise. Add pprev_nl and nml_err_msg
arguments.
(init_at_eol): Removed.
* io/read.c (convert_real, read_l, read_a, next_char, read_decimal,
read_radix, read_f, read_x): Add dtp argument, pass it all around,
adjust for internal function API changes and removal of global
variables.
(set_integer): Adjust internal_error caller.
* io/write.c (no_leading_blank, nml_delim): Remove variables.
(write_a, calculate_sign, calculate_G_format, output_float,
write_l, write_float, write_int, write_decimal, write_i, write_b,
write_o, write_z, write_d, write_e, write_f, write_en, write_es,
write_x, write_char, write_logical, write_integer, write_character,
write_real, write_complex, write_separator,
list_formatted_write_scalar, list_formatted_write, nml_write_obj,
namelist_write): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
(extract_int, extract_uint, extract_real): Adjust internal_error
callers.
* runtime/fpu.c (_GNU_SOURCE): Don't define here.
* runtime/error.c: Include ../io/unix.h.
(filename, line): Remove variables.
(st_printf): Pass address of a local variable to init_error_stream.
(show_locus): Add cmp argument. Use fields it points to rather than
filename and line variables.
(os_error, runtime_error): Remove show_locus calls.
(internal_error): Add cmp argument. Pass it down to show_locus.
(generate_error): Likewise. Use flags bitmask instead of non-NULL
check for iostat and iomsg parameter presence, adjust for st_*
calling convention changes.
* runtime/stop.c (stop_numeric, stop_string): Remove show_locus
calls.
* runtime/pause.c (pause_numeric, pause_string): Likewise.
* runtime/string.c: Include ../io/io.h.
(find_option): Add cmp argument. Pass it down to generate_error.
* intrinsics/flush.c (recursive_flush): Remove.
(flush_i4, flush_i8): Use flush_all_units. Add unlock_unit
call.
* intrinsics/rand.c: Include ../io/io.h.
(rand_seed_lock): New variable.
(srand, irand): Add locking.
(init): New constructor function.
* intrinsics/random.c: Include ../io/io.h.
(random_lock): New variable.
(random_r4, random_r8, arandom_r4, arandom_r8): Add locking.
(random_seed): Likewise. open failed if fd < 0. Set i correctly.
(init): New constructor function.
* intrinsics/system_clock.c (tp0, t0): Remove.
(system_clock_4, system_clock_8): Don't subtract tp0/t0 from current
time, use just integer arithmetics.
* intrinsics/tty.c (isatty_l4, isatty_l8, ttynam_sub): Add
unlock_unit calls.
From-SVN: r107328
2005-11-22 06:03:56 +08:00
|
|
|
|
|
2015-08-31 22:02:43 +08:00
|
|
|
|
# Check out #pragma weak.
|
|
|
|
|
LIBGFOR_GTHREAD_WEAK
|
|
|
|
|
|
2015-08-31 18:37:30 +08:00
|
|
|
|
# Check out weakref support.
|
|
|
|
|
LIBGFOR_CHECK_WEAKREF
|
re PR fortran/14943 (read/write code generation is not thread safe)
gcc/fortran/
PR fortran/14943
PR fortran/21647
* Make-lang.in (fortran/trans-io.o): Depend on fortran/ioparm.def.
* dump-parse-tree.c (gfc_show_code_node): Dump c->block for
EXEC_{READ,WRITE,IOLENGTH} nodes.
* io.c (terminate_io, match_io, gfc_match_inquire): Put data
transfer commands into EXEC_{READ,WRITE,IOLENGTH}'s code->block.
* resolve.c (resolve_blocks): Handle EXEC_{READ,WRITE,IOLENGTH}.
* trans-io.c (ioparm_unit, ioparm_err, ioparm_end, ioparm_eor,
ioparm_list_format, ioparm_library_return, ioparm_iostat,
ioparm_exist, ioparm_opened, ioparm_number, ioparm_named,
ioparm_rec, ioparm_nextrec, ioparm_size, ioparm_recl_in,
ioparm_recl_out, ioparm_iolength, ioparm_file, ioparm_file_len,
ioparm_status, ioparm_status_len, ioparm_access, ioparm_access_len,
ioparm_form, ioparm_form_len, ioparm_blank, ioparm_blank_len,
ioparm_position, ioparm_position_len, ioparm_action,
ioparm_action_len, ioparm_delim, ioparm_delim_len, ioparm_pad,
ioparm_pad_len, ioparm_format, ioparm_format_len, ioparm_advance,
ioparm_advance_len, ioparm_name, ioparm_name_len,
ioparm_internal_unit, ioparm_internal_unit_len,
ioparm_internal_unit_desc, ioparm_sequential, ioparm_sequential_len,
ioparm_direct, ioparm_direct_len, ioparm_formatted,
ioparm_formatted_len, ioparm_unformatted, ioparm_unformatted_len,
ioparm_read, ioparm_read_len, ioparm_write, ioparm_write_len,
ioparm_readwrite, ioparm_readwrite_len, ioparm_namelist_name,
ioparm_namelist_name_len, ioparm_namelist_read_mode, ioparm_iomsg,
ioparm_iomsg_len, ioparm_var): Remove.
(enum ioparam_type, enum iofield_type, enum iofield,
enum iocall): New enums.
(gfc_st_parameter_field, gfc_st_parameter): New typedefs.
(st_parameter, st_parameter_field, iocall): New variables.
(ADD_FIELD, ADD_STRING): Remove.
(dt_parm, dt_post_end_block): New variables.
(gfc_build_st_parameter): New function.
(gfc_build_io_library_fndecls): Use it. Initialize iocall
array rather than ioparm_*, add extra first arguments to
the function types.
(set_parameter_const): New function.
(set_parameter_value): Add type argument, return a bitmask.
Changed to set a field in automatic structure variable rather
than set a field in a global _gfortran_ioparm variable.
(set_parameter_ref): Likewise. If requested var has different
size than what field should point to, call with a temporary and
then copy into the user variable. Add postblock argument.
(set_string): Remove var_len argument, add type argument, return
a bitmask. Changed to set fields in automatic structure variable
rather than set a field in a global _gfortran_ioparm variable.
(set_internal_unit): Remove iunit, iunit_len, iunit_desc arguments,
add var argument. Return a bitmask. Changed to set fields in
automatic structure variable rather than set a field in a global
_gfortran_ioparm variable.
(set_flag): Removed.
(io_result): Add var argument. Changed to read common.flags field
from automatic structure variable and bitwise AND it with 3.
(set_error_locus): Add var argument. Changed to set fields in
automatic structure variable rather than set a field in a global
_gfortran_{filename,line} variables.
(gfc_trans_open): Use gfc_start_block rather than gfc_init_block.
Create a temporary st_parameter_* structure. Adjust callers of
all above mentioned functions. Pass address of the temporary
variable as first argument to the generated function call.
Use iocall array rather than ioparm_* separate variables.
(gfc_trans_close, build_filepos, gfc_trans_inquire): Likewise.
(build_dt): Likewise. Change first argument to tree from tree *.
Don't dereference code->ext.dt if last_dt == INQUIRE. Emit
IOLENGTH argument setup here. Set dt_parm/dt_post_end_block
variables and gfc_trans_code the nested data transfer commands
in code->block.
(gfc_trans_iolength): Just set last_dt and call build_dt immediately.
(transfer_namelist_element): Pass address of dt_parm variable
to generated functions. Use iocall array rather than ioparm_*
separate variables.
(gfc_trans_backspace, gfc_trans_endfile, gfc_trans_rewind,
gfc_trans_flush, gfc_trans_read, gfc_trans_write): Use iocall array
rather than ioparm_* separate variables.
(gfc_trans_dt_end): Likewise. Pass address of dt_parm variable
as first argument to generated function. Adjust io_result caller.
Prepend dt_post_end_block before io_result code.
(transfer_expr): Use iocall array rather than ioparm_* separate
variables. Pass address of dt_parm variables as first argument
to generated functions.
* ioparm.def: New file.
gcc/testsuite/
PR fortran/24774
* gfortran.dg/inquire_9.f90: New test.
PR fortran/21647
* gfortran.fortran-torture/execute/inquire_5.f90: New test.
libgfortran/
PR fortran/24774
PR fortran/14943
PR fortran/21647
* Makefile.am (AM_CPPFLAGS): Add gcc directories as -I paths,
add -D_GNU_SOURCE.
* Makefile.in: Regenerated.
* acinclude.m4 (LIBGFOR_CHECK_SYNC_FETCH_AND_ADD,
LIBGFOR_CHECK_GTHR_DEFAULT, LIBGFOR_CHECK_PRAGMA_WEAK): New macros.
* configure.ac: Add them.
* configure: Rebuilt.
* config.h.in: Rebuilt.
* libtool-version: Bump libgfortran.so SONAME to libgfortran.so.1.
* libgfortran.h (library_start, show_locus, internal_error,
generate_error, find_option): Add st_parameter_common * argument.
(library_end): Change into a dummy macro.
* io/io.h: Include gthr.h.
(SUPPORTS_WEAK): Define if HAVE_PRAGMA_WEAK.
(CHARACTER): Remove define.
(st_parameter, global_t): Remove typedef.
(ioparm, g, ionml, current_unit): Remove variables.
(init_error_stream): Remove prototype.
(CHARACTER1, CHARACTER2): Define.
(st_parameter_common, st_parameter_open, st_parameter_close,
st_parameter_filepos, st_parameter_inquire, st_parameter_dt): New
typedefs.
(IOPARM_LIBRETURN_MASK, IOPARM_LIBRETURN_OK, IOPARM_LIBRETURN_ERROR,
IOPARM_LIBRETURN_END, IOPARM_LIBRETURN_EOR, IOPARM_ERR, IOPARM_END,
IOPARM_EOR, IOPARM_HAS_IOSTAT, IOPARM_HAS_IOMSG, IOPARM_COMMON_MASK,
IOPARM_OPEN_HAS_RECL_IN, IOPARM_OPEN_HAS_FILE, IOPARM_OPEN_HAS_STATUS,
IOPARM_OPEN_HAS_ACCESS, IOPARM_OPEN_HAS_FORM, IOPARM_OPEN_HAS_BLANK,
IOPARM_OPEN_HAS_POSITION, IOPARM_OPEN_HAS_ACTION,
IOPARM_OPEN_HAS_DELIM, IOPARM_OPEN_HAS_PAD, IOPARM_CLOSE_HAS_STATUS,
IOPARM_INQUIRE_HAS_EXIST, IOPARM_INQUIRE_HAS_OPENED,
IOPARM_INQUIRE_HAS_NUMBER, IOPARM_INQUIRE_HAS_NAMED,
IOPARM_INQUIRE_HAS_NEXTREC, IOPARM_INQUIRE_HAS_RECL_OUT,
IOPARM_INQUIRE_HAS_FILE, IOPARM_INQUIRE_HAS_ACCESS,
IOPARM_INQUIRE_HAS_FORM, IOPARM_INQUIRE_HAS_BLANK,
IOPARM_INQUIRE_HAS_POSITION, IOPARM_INQUIRE_HAS_ACTION,
IOPARM_INQUIRE_HAS_DELIM, IOPARM_INQUIRE_HAS_PAD,
IOPARM_INQUIRE_HAS_NAME, IOPARM_INQUIRE_HAS_SEQUENTIAL,
IOPARM_INQUIRE_HAS_DIRECT, IOPARM_INQUIRE_HAS_FORMATTED,
IOPARM_INQUIRE_HAS_UNFORMATTED, IOPARM_INQUIRE_HAS_READ,
IOPARM_INQUIRE_HAS_WRITE, IOPARM_INQUIRE_HAS_READWRITE,
IOPARM_DT_LIST_FORMAT, IOPARM_DT_NAMELIST_READ_MODE,
IOPARM_DT_HAS_REC, IOPARM_DT_HAS_SIZE, IOPARM_DT_HAS_IOLENGTH,
IOPARM_DT_HAS_FORMAT, IOPARM_DT_HAS_ADVANCE,
IOPARM_DT_HAS_INTERNAL_UNIT, IOPARM_DT_HAS_NAMELIST_NAME,
IOPARM_DT_IONML_SET): Define.
(gfc_unit): Add lock, waiting and close fields. Change file
from flexible array member into pointer to char.
(open_external): Add st_parameter_open * argument.
(find_file, file_exists): Add file and file_len arguments.
(flush_all_units): New prototype.
(max_offset, unit_root, unit_lock): New variable.
(is_internal_unit, is_array_io, next_array_record,
parse_format, next_format, unget_format, format_error,
read_block, write_block, next_record, convert_real,
read_a, read_f, read_l, read_x, read_radix, read_decimal,
list_formatted_read, finish_list_read, namelist_read,
namelist_write, write_a, write_b, write_d, write_e, write_en,
write_es, write_f, write_i, write_l, write_o, write_x, write_z,
list_formatted_write, get_unit): Add st_parameter_dt * argument.
(insert_unit): Remove prototype.
(find_or_create_unit, unlock_unit): New prototype.
(new_unit): Return gfc_unit *. Add st_parameter_open *
and gfc_unit * arguments.
(free_fnodes): Remove prototype.
(free_format_data): New prototype.
(scratch): Remove.
(init_at_eol): Remove prototype.
(free_ionml): New prototype.
(inc_waiting_locked, predec_waiting_locked, dec_waiting_unlocked):
New inline functions.
* io/unit.c (max_offset, unit_root, unit_lock): New variables.
(insert): Adjust os_error caller.
(insert_unit): Made static. Allocate memory here, initialize
lock and after inserting it return it, locked.
(delete_unit): Adjust for deletion of g.
(find_unit_1): New function.
(find_unit): Use it.
(find_or_create_unit): New function.
(get_unit): Add dtp argument, change meaning of the int argument
as creation request flag. Adjust for different st_* calling
conventions, lock internal unit's lock before returning it
and removal of g. Call find_unit_1 instead of find_unit.
(is_internal_unit, is_array_io): Add dtp argument, adjust for
removal of most of global variables.
(init_units): Initialize unit_lock. Adjust insert_unit callers
and adjust for g removal.
(close_unit_1): New function.
(close_unit): Use it.
(unlock_unit): New function.
(close_units): Lock unit_lock, use close_unit_1 rather than
close_unit.
* io/close.c (st_close): Add clp argument. Adjust for new
st_* calling conventions and internal function API changes.
* io/file_pos.c (st_backspace, st_endfile, st_rewind, st_flush):
Add fpp argument. Adjust for new st_* calling conventions and
internal function API changes.
(formatted_backspace, unformatted_backspace): Likewise. Add
u argument.
* io/open.c (edit_modes, st_open): Add opp argument. Adjust for
new st_* calling conventions and internal function API changes.
(already_open): Likewise. If not HAVE_UNLINK_OPEN_FILE, unlink
scratch file. Instead of calling close_unit just call sclose,
free u->file if any and clear a few u fields before calling
new_unit.
(new_unit): Return gfc_unit *. Add opp and u arguments.
Adjust for new st_* calling conventions and internal function
API changes. Don't allocate unit here, rather than work with
already created unit u already locked on entry. In case
of failure, close_unit it.
* io/unix.c: Include unix.h.
(BUFFER_SIZE, unix_stream): Moved to unix.h.
(unit_to_fd): Add unlock_unit call.
(tempfile): Add opp argument, use its fields rather than ioparm.
(regular_file): Likewise.
(open_external): Likewise. Only unlink file if fd >= 0.
(init_error_stream): Add error argument, set structure it points
to rather than filling static variable and returning its address.
(FIND_FILE0_DECL, FIND_FILE0_ARGS): Define.
(find_file0): Use them. Don't crash if u->s == NULL.
(find_file): Add file and file_len arguments, use them instead
of ioparm. Add locking. Pass either an array of 2 struct stat
or file and file_len pair to find_file0.
(flush_all_units_1, flush_all_units): New functions.
(file_exists): Add file and file_len arguments, use them instead
of ioparm.
* io/unix.h: New file.
* io/lock.c (ioparm, g, ionml): Remove variables.
(library_start): Add cmp argument, adjust for new st_* calling
conventions.
(library_end): Remove.
(free_ionml): New function.
* io/inquire.c (inquire_via_unit, inquire_via_filename,
st_inquire): Add iqp argument, adjust for new st_* calling
conventions and internal function API changes.
* io/format.c (FARRAY_SIZE): Decrease to 64.
(fnode_array, format_data): New typedefs.
(avail, array, format_string, string, error, saved_token, value,
format_string_len, reversion_ok, saved_format): Remove variables.
(colon_node): Add const.
(free_fnode, free_fnodes): Remove.
(free_format_data): New function.
(next_char, unget_char, get_fnode, format_lex, parse_format_list,
format_error, parse_format, revert, unget_format, next_test): Add
fmt or dtp arguments, pass it all around, adjust for internal
function API changes and adjust for removal of global variables.
(next_format): Likewise. Constify return type.
(next_format0): Constify return type.
* io/transfer.c (current_unit, sf_seen_eor, eor_condition, max_pos,
skips, pending_spaces, scratch, line_buffer, advance_status,
transfer): Remove variables.
(transfer_integer, transfer_real, transfer_logical,
transfer_character, transfer_complex, transfer_array, current_mode,
read_sf, read_block, read_block_direct, write_block,
write_block_direct, unformatted_read, unformatted_write,
type_name, write_constant_string, require_type,
formatted_transfer_scalar, us_read, us_write, pre_position,
data_transfer_init, next_record_r, next_record_w, next_record,
finalize_transfer, iolength_transfer, iolength_transfer_init,
st_iolength, st_iolength_done, st_read, st_read_done, st_write,
st_write_done, st_set_nml_var, st_set_nml_var_dim,
next_array_record): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
* io/list_read.c (repeat_count, saved_length, saved_used,
input_complete, at_eol, comma_flag, last_char, saved_string,
saved_type, namelist_mode, nml_read_error, value, parse_err_msg,
nml_err_msg, prev_nl): Remove variables.
(push_char, free_saved, next_char, unget_char, eat_spaces,
eat_separator, finish_separator, nml_bad_return, convert_integer,
parse_repeat, read_logical, read_integer, read_character,
parse_real, read_complex, read_real, check_type,
list_formatted_read_scalar, list_formatted_read, finish_list_read,
find_nml_node, nml_untouch_nodes, nml_match_name, nml_query,
namelist_read): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
(nml_parse_qualifier): Likewise. Add parse_err_msg argument.
(nml_read_obj): Likewise. Add pprev_nl, nml_err_msg, clow and
chigh arguments.
(nml_get_obj_data): Likewise. Add pprev_nl and nml_err_msg
arguments.
(init_at_eol): Removed.
* io/read.c (convert_real, read_l, read_a, next_char, read_decimal,
read_radix, read_f, read_x): Add dtp argument, pass it all around,
adjust for internal function API changes and removal of global
variables.
(set_integer): Adjust internal_error caller.
* io/write.c (no_leading_blank, nml_delim): Remove variables.
(write_a, calculate_sign, calculate_G_format, output_float,
write_l, write_float, write_int, write_decimal, write_i, write_b,
write_o, write_z, write_d, write_e, write_f, write_en, write_es,
write_x, write_char, write_logical, write_integer, write_character,
write_real, write_complex, write_separator,
list_formatted_write_scalar, list_formatted_write, nml_write_obj,
namelist_write): Add dtp argument, pass it all around, adjust for
internal function API changes and removal of global variables.
(extract_int, extract_uint, extract_real): Adjust internal_error
callers.
* runtime/fpu.c (_GNU_SOURCE): Don't define here.
* runtime/error.c: Include ../io/unix.h.
(filename, line): Remove variables.
(st_printf): Pass address of a local variable to init_error_stream.
(show_locus): Add cmp argument. Use fields it points to rather than
filename and line variables.
(os_error, runtime_error): Remove show_locus calls.
(internal_error): Add cmp argument. Pass it down to show_locus.
(generate_error): Likewise. Use flags bitmask instead of non-NULL
check for iostat and iomsg parameter presence, adjust for st_*
calling convention changes.
* runtime/stop.c (stop_numeric, stop_string): Remove show_locus
calls.
* runtime/pause.c (pause_numeric, pause_string): Likewise.
* runtime/string.c: Include ../io/io.h.
(find_option): Add cmp argument. Pass it down to generate_error.
* intrinsics/flush.c (recursive_flush): Remove.
(flush_i4, flush_i8): Use flush_all_units. Add unlock_unit
call.
* intrinsics/rand.c: Include ../io/io.h.
(rand_seed_lock): New variable.
(srand, irand): Add locking.
(init): New constructor function.
* intrinsics/random.c: Include ../io/io.h.
(random_lock): New variable.
(random_r4, random_r8, arandom_r4, arandom_r8): Add locking.
(random_seed): Likewise. open failed if fd < 0. Set i correctly.
(init): New constructor function.
* intrinsics/system_clock.c (tp0, t0): Remove.
(system_clock_4, system_clock_8): Don't subtract tp0/t0 from current
time, use just integer arithmetics.
* intrinsics/tty.c (isatty_l4, isatty_l8, ttynam_sub): Add
unlock_unit calls.
From-SVN: r107328
2005-11-22 06:03:56 +08:00
|
|
|
|
|
2005-08-28 00:01:54 +08:00
|
|
|
|
# Various other checks on target
|
|
|
|
|
LIBGFOR_CHECK_UNLINK_OPEN_FILE
|
|
|
|
|
|
2005-09-08 05:25:40 +08:00
|
|
|
|
# Check whether line terminator is LF or CRLF
|
|
|
|
|
LIBGFOR_CHECK_CRLF
|
|
|
|
|
|
2016-12-03 17:44:35 +08:00
|
|
|
|
# Check whether we support AVX extensions
|
|
|
|
|
LIBGFOR_CHECK_AVX
|
|
|
|
|
|
2021-12-07 02:57:32 +08:00
|
|
|
|
# Check whether we support AVX2 extensions
|
2016-12-03 17:44:35 +08:00
|
|
|
|
LIBGFOR_CHECK_AVX2
|
|
|
|
|
|
2021-12-07 02:57:32 +08:00
|
|
|
|
# Check whether we support AVX512f extensions
|
2016-12-03 17:44:35 +08:00
|
|
|
|
LIBGFOR_CHECK_AVX512F
|
|
|
|
|
|
2017-05-26 05:51:27 +08:00
|
|
|
|
# Check for FMA3 extensions
|
|
|
|
|
LIBGFOR_CHECK_FMA3
|
|
|
|
|
|
|
|
|
|
# Check for FMA4 extensions
|
|
|
|
|
LIBGFOR_CHECK_FMA4
|
|
|
|
|
|
|
|
|
|
# Check if AVX128 works
|
|
|
|
|
LIBGFOR_CHECK_AVX128
|
|
|
|
|
|
2017-01-17 17:38:48 +08:00
|
|
|
|
# Determine what GCC version number to use in filesystem paths.
|
|
|
|
|
GCC_BASE_VER
|
|
|
|
|
|
2004-05-31 05:58:10 +08:00
|
|
|
|
AC_CACHE_SAVE
|
|
|
|
|
|
|
|
|
|
if test ${multilib} = yes; then
|
|
|
|
|
multilib_arg="--enable-multilib"
|
|
|
|
|
else
|
|
|
|
|
multilib_arg=
|
|
|
|
|
fi
|
|
|
|
|
|
2010-11-17 05:23:19 +08:00
|
|
|
|
# Write our Makefile and spec file.
|
|
|
|
|
AC_CONFIG_FILES([
|
|
|
|
|
Makefile
|
|
|
|
|
libgfortran.spec
|
|
|
|
|
])
|
2004-05-31 05:58:10 +08:00
|
|
|
|
AC_OUTPUT
|