This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,build] PR 46540 - add --disable-libquadmath/--disable-libquadmath-support
Tobias Burnus wrote:
H.J. Lu wrote:
On Sat, Dec 4, 2010 at 8:15 AM, Tobias Burnus<burnus@net-b.de> wrote:
This patch adds two configure options:
--disable-libquadmath
which disables the libquadmath build (e.g. to use the system's
libquadmath)
This isn't very clear. We already have --with-system-zlib, why not
--with-system-libquadmath?
Well, we also have: --enable-libada and --enable-libssp.
I have now used --with-system-libquadmath but I have to admit I find it
much more misleading. --disable-libquadmath does that the option was
stating: It does not build "libquadmath".
--with-system-libquadmath somehow implies that the system *has* to
provide libquadmath - which is not (generally) true. It is just not
build. -- Only if you build the Fortran front end on a system which
supports __float128 and you did not disable the support using
--disable-libquadmath-support, you have to provide libquadmath such that
it is in the include ("-I") and library ("-L") path.
For the case you only build, e.g., C or C++ the option
--without-system-libquadmath implies that the library is build and
--with-system-libquadmath (default on systems supporting it) implies
that the library is not build (note: a system library is not needed) --
which I find much more confusing. Or if I want to build on x86-64
Fortran without quadmath support and without the library, the options
you have to use are: --disable-libquadmath-support
--with-system-libquadmath -- which somehow looks strange.
The attached patch has been a couple of times in different variants
bootstrapped on x86-64-linux.
OK for the trunk?
(For the variant with --disable-libquadmath, cf. patch snippet below.)
Tobias
PS: I have included a patch for "gcc/doc/install.html" (describing
--disable-libquadmath[-support]).
PPS: A variant would for --(disable|enable)-libquadmath:
+AC_ARG_ENABLE(libquadmath,
+[ --disable-libquadmath do not build libquadmath directory],
+ENABLE_LIBQUADMATH=$enableval,
+ENABLE_LIBQUADMATH=yes)
+if test "${ENABLE_LIBQUADMATH}" = "no" ; then
+ noconfigdirs="$noconfigdirs target-libquadmath"
+fi
+
+
/
2010-12-05 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
* configure.ac: Add --disable-libquadmath and
--disable-libquadmath-support.
* configure: Regenerate.
gcc/
2010-12-05 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
* configure.ac: Handle --disable-libquadmath-support.
* configure: Regenerate.
gcc/fortran/
2010-12-05 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
* trans-types.c (gfc_init_kinds): Handle
--disable-libquadmath-support.
libgfortran/
2010-12-05 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
* acinclude.m4 (LIBGFOR_CHECK_FLOAT128): Honour
--disable-libquadmath-support.
* configure.ac: Handle --disable-libquadmath-support.
* configure: Regenerate.
diff --git a/configure.ac b/configure.ac
index fcf5ba2..d47bbbd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -458,6 +458,25 @@ case "${host}" in
esac
+AC_ARG_WITH(system-libquadmath,
+[ --with-system-libquadmath use the system instead of included libquadmath (default is no)],
+[SYSTEM_LIBQUADMATH=$withval],
+[SYSTEM_LIBQUADMATH=no])
+if test "${SYSTEM_LIBQUADMATH}" != "no" ; then
+ noconfigdirs="$noconfigdirs target-libquadmath"
+fi
+
+
+AC_ARG_ENABLE(libquadmath-support,
+[ --enable-libquadmath-support enable libquadmath support for Fortran (default)],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+ enable_libquadmath_support=no
+fi
+
+
AC_ARG_ENABLE(libada,
[ --enable-libada build libada directory],
ENABLE_LIBADA=$enableval,
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 98de035..cbbfe10 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -4775,6 +4775,17 @@ if test x"$enable_plugin" = x"yes"; then
AC_DEFINE(ENABLE_PLUGIN, 1, [Define to enable plugin support.])
fi
+
+AC_ARG_ENABLE(libquadmath-support,
+[ --disable-libquadmath-support disable libquadmath support for Fortran],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" != "no" ; then
+ AC_DEFINE(USE_LIBQUADMATH_SUPPORT, 1,
+ [Define to 1 to enable libquadmath support])
+fi
+
+
# Configure the subdirectories
# AC_CONFIG_SUBDIRS($subdirs)
diff --git a/gcc/fortran/trans-types.c b/gcc/fortran/trans-types.c
index 771b582..c5aac3e 100644
--- a/gcc/fortran/trans-types.c
+++ b/gcc/fortran/trans-types.c
@@ -415,12 +415,11 @@ gfc_init_kinds (void)
/* Only let float, double, long double and __float128 go through.
Runtime support for others is not provided, so they would be
- useless. TODO: TFmode support should be enabled once libgfortran
- support is done. */
+ useless. */
if (mode != TYPE_MODE (float_type_node)
&& (mode != TYPE_MODE (double_type_node))
&& (mode != TYPE_MODE (long_double_type_node))
-#ifdef LIBGCC2_HAS_TF_MODE
+#if defined(LIBGCC2_HAS_TF_MODE) && defined(USE_LIBQUADMATH_SUPPORT)
&& (mode != TFmode)
#endif
)
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index cb016f1..9873d9f 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -279,6 +279,9 @@ esac])
dnl Check whether we have a __float128 type
AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
LIBQUADSPEC=
+
+ if test "x$enable_libquadmath_support" != xno; then
+
AC_CACHE_CHECK([whether we have a usable __float128 type],
libgfor_cv_have_float128, [
AC_TRY_LINK([
@@ -341,6 +344,12 @@ AC_DEFUN([LIBGFOR_CHECK_FLOAT128], [
LIBQUADINCLUDE=
fi
fi
+ else
+ # for --disable-quadmath
+ LIBQUADLIB=
+ LIBQUADLIB_DEP=
+ LIBQUADINCLUDE=
+ fi
dnl For the spec file
AC_SUBST(LIBQUADSPEC)
diff --git a/libgfortran/configure.ac b/libgfortran/configure.ac
index 47315d5..ba62ce8 100644
--- a/libgfortran/configure.ac
+++ b/libgfortran/configure.ac
@@ -462,7 +462,17 @@ LIBGFOR_CHECK_MINGW_SNPRINTF
# Check for a broken powf implementation
LIBGFOR_CHECK_FOR_BROKEN_POWF
-# Check whether we have a __float128 type
+# Check whether libquadmath should be used
+AC_ARG_ENABLE(libquadmath-support,
+[ --disable-libquadmath-support disable libquadmath support for Fortran],
+ENABLE_LIBQUADMATH_SUPPORT=$enableval,
+ENABLE_LIBQUADMATH_SUPPORT=yes)
+enable_libquadmath_support=
+if test "${ENABLE_LIBQUADMATH_SUPPORT}" = "no" ; then
+ enable_libquadmath_support=no
+fi
+
+# Check whether we have a __float128 type, depends on enable_libquadmath_support
LIBGFOR_CHECK_FLOAT128
# Check for GNU libc feenableexcept
2010-12-05 Tobias Burnus <burnus@net-b.de>
PR fortran/46540
* doc/install.texi: Document --disable-libquadmath an
--disable-libquadmath-support
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index fbb2d4c..abe80aa 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -1337,6 +1337,16 @@ do a @samp{make -C gcc gnatlib_and_tools}.
Specify that the run-time libraries for stack smashing protection
should not be built.
+@item --disable-libquadmath
+Specify that the GCC quad-precision math library should not be build.
+On some systems, the library is required to be linkable when building
+the Fortran front end, unless @option{--disable-libquadmath-support}
+is used.
+
+@item --disable-libquadmath-support
+Specify that the Fortran front end and @code{libgfortran} do not add
+support for @code{libquadmath} on systems supporting it.
+
@item --disable-libgomp
Specify that the run-time libraries used by GOMP should not be built.