Alexandre Oliva wrote:
Revision 193063 brought in calls to fraiseexcept() into libquadmath,
which caused a build regression on Fedora 16 (BLAG 160k actually) x86_64
while building an i686-linux-gnu native toolchain.
The problem is that glibc has an extern inline definition of
fraiseexcept that is introduced by including fenv.h (it's in
bits/fenv.h), and this definition requires SSE support regardless of
target arch of word width, so it doesn't work for an i686 native that
doesn't assume SSE registers and instructions are available.
This bug is fixed in newer versions of glibc, but I figured it wouldn't
hurt to have a work-around in place for libquadmath to build, detecting
that the extern inline in the header is broken and introducing a wrapper
that bypasses the header so as to use the out-of-line definition in the
math library.
Is this ok to install?
+ AC_CACHE_CHECK([whether feraiseexcept is broken in fenv.h],
[quadmath_cv_feraiseexcept_fenv_broken],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <fenv.h>]],
[feraiseexcept (FE_INVALID);])],
[quadmath_cv_feraiseexcept_fenv_broken=no],
[quadmath_cv_feraiseexcept_fenv_broken=yes])])
The line is too long; there is no reason that it is longer than 80
characters.
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
I think you should use automake 1.11.1; at least that's what is stated
in http://gcc.gnu.org/install/prerequisites.html
(Side note: I wouldn't mind if GCC would update to a newer required
autoconf/automake version.)
+/* Optional replacement for compile-time broken feraiseexcept. */
+#undef QUADMATH_FERAISEEXCEPT
That comment doesn't reflect the use (cf. below). Shouldn't that be
something like "Function to call for raising an exception; allows for
replacing a compile-time broken feraiseexcept."?
-#ifdef USE_FENV_H
- feraiseexcept (FE_INVALID);
+#ifdef QUADMATH_FERAISEEXCEPT
+ QUADMATH_FERAISEEXCEPT (FE_INVALID);
#endif
+/* Wrapper for feraiseexcept. This file is in the public domain.
+ Contributed by Alexandre Oliva<aol...@redhat.com>
+ See QUADMATH_FERAISEEXCEPT in configure.ac for more information. */
+
+int
+__quadmath_feraiseexcept (int xcpt)
+{
+ feraiseexcept (xcpt);
+}
I personally would like to see a tiny bit longer comment, additionally
explaining quickly the purpose. For instance: "Avoid calling an inline
function." or something like that. Additionally, GCC warns by default
that you do not return an int and that feraiseexcept is implicitly
declared. Can you fix both?
Otherwise, it looks okay to me.
Tobias