Hello,

Taylor R Campbell writes:

   Date: Mon, 27 Feb 2012 10:21:23 +0100
   From: Francis GUDIN <fgu...@nerim.net>

   I don't feel alone anymore: same issue on DragonFly x86. I had a
   few private mails back and forth with T. Campbell about it, but I
   didn't make any significant progress, alas.

Sorry, I haven't had any time lately to look into this.  I will have
some time in a couple weeks to set up a FreeBSD VM and debug it
myself.

If you want to poke around in low-level details yourself, you might
look into whether Scheme and FreeBSD agree on the structure of fenv_t
-- if Scheme can't find <fenv.h>, it implements its own version on x86
and x86-64, but perhaps due to a bug it gets some parts of <fenv.h>
from FreeBSD and uses its own version of other parts and thereby gets
confused.  See floenv.{c,h} and cmpintmd/x86-fenv.{c,h} in the
microcode directory for where all this happens.

About fenv_t, my build always had HAVE_FENV_H and HAVE_FENV_T defined in microcode/config.h; furthermore, a small patch to microcode/configure.ac enabled proper detection of a handful of fe*() that were misdetected.
Everything available in DragonFly's fenv(3) is recognized.
In case there's interest, I attach the diff.

I'll try to dig a bit in the files you mentionned.

Thanks for your help!
--
Francis

--- microcode/configure.ac.orig 2011-06-27 05:16:57.000000000 +0200
+++ microcode/configure.ac      2012-01-11 22:13:02.449002000 +0100
@@ -371,6 +371,108 @@
 if test "x$ac_cv_header_fenv_h" = "xyes"; then
   AC_CHECK_TYPES([fenv_t], [], [], [SCM_INC_FENV])
   AC_CHECK_TYPES([fexcept_t], [], [], [SCM_INC_FENV])
+
+  ac_cv_func_feclearexcept=no;
+  AC_MSG_CHECKING([for feclearexcept in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int except, ret;
+                   ret = feclearexcept(except);
+                  ],[ac_cv_func_feclearexcept=yes], 
[ac_cv_func_feclearexcept=no])
+  AC_MSG_RESULT($ac_cv_func_feclearexcept)
+  if test x"$ac_cv_func_feclearexcept" = x"yes"; then
+    AC_DEFINE([HAVE_FECLEAREXCEPT], [1],
+      [Define to 1 if you have the feclearexcept function.])
+  fi
+
+  ac_cv_func_fegetexcept=no;
+  AC_MSG_CHECKING([for fegetexcept in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int ret;
+                   ret = fegetexcept();
+                  ],[ac_cv_func_fegetexcept=yes], [ac_cv_func_fegetexcept=no])
+  AC_MSG_RESULT($ac_cv_func_fegetexcept)
+  if test x"$ac_cv_func_fegetexcept" = x"yes"; then
+    AC_DEFINE([HAVE_FEGETEXCEPT], [1],
+      [Define to 1 if you have the fegetexcept function.])
+  fi
+
+  ac_cv_func_fegetexceptflag=no;
+  AC_MSG_CHECKING([for fegetexceptflag in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int except;
+                   fexcept_t* pflag;
+                   int ret;
+                   ret = fegetexceptflag(pflag, except);
+                  ],[ac_cv_func_fegetexceptflag=yes], 
[ac_cv_func_fegetexceptflag=no])
+  AC_MSG_RESULT($ac_cv_func_fegetexceptflag)
+  if test x"$ac_cv_func_fegetexceptflag" = x"yes"; then
+    AC_DEFINE([HAVE_FEGETEXCEPTFLAG], [1],
+      [Define to 1 if you have the fegetexceptflag function.])
+  fi
+
+  ac_cv_func_fegetround=no;
+  AC_MSG_CHECKING([for fegetround in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int ret;
+                   ret = fegetround();
+                  ],[ac_cv_func_fegetround=yes], [ac_cv_func_fegetround=no])
+  AC_MSG_RESULT($ac_cv_func_fegetround)
+  if test x"$ac_cv_func_fegetround" = x"yes"; then
+    AC_DEFINE([HAVE_FEGETROUND], [1],
+      [Define to 1 if you have the fegetround function.])
+  fi
+
+  ac_cv_func_fesetenv=no;
+  AC_MSG_CHECKING([for fesetenv in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [fenv_t* penv;
+                   int ret;
+                   ret = fesetenv(penv);
+                  ],[ac_cv_func_fesetenv=yes], [ac_cv_func_fesetenv=no])
+  AC_MSG_RESULT($ac_cv_func_fesetenv)
+  if test x"$ac_cv_func_fesetenv" = x"yes"; then
+    AC_DEFINE([HAVE_FESETENV], [1],
+      [Define to 1 if you have the fesetenv function.])
+  fi
+
+  ac_cv_func_fesetexceptflag=no;
+  AC_MSG_CHECKING([for fesetexceptflag in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int except;
+                   fexcept_t* pflag;
+                   int ret;
+                   ret = fesetexceptflag(pflag, except);
+                  ],[ac_cv_func_fesetexceptflag=yes], 
[ac_cv_func_fesetexceptflag=no])
+  AC_MSG_RESULT($ac_cv_func_fesetexceptflag)
+  if test x"$ac_cv_func_fesetexceptflag" = x"yes"; then
+    AC_DEFINE([HAVE_FESETEXCEPTFLAG], [1],
+      [Define to 1 if you have the fesetexceptflag function.])
+  fi
+
+  ac_cv_func_fesetround=no;
+  AC_MSG_CHECKING([for fesetround in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int mode, ret;
+                   ret = fesetround(mode);
+                  ],[ac_cv_func_fesetround=yes], [ac_cv_func_fesetround=no])
+  AC_MSG_RESULT($ac_cv_func_fesetround)
+  if test x"$ac_cv_func_fesetround" = x"yes"; then
+    AC_DEFINE([HAVE_FESETROUND], [1],
+      [Define to 1 if you have the fesetround function.])
+  fi
+
+  ac_cv_func_fetestexcept=no;
+  AC_MSG_CHECKING([for fetestexcept in fenv.h])
+  AC_TRY_COMPILE([#include <fenv.h>],
+                  [int except, ret;
+                   ret = fetestexcept(except);
+                  ],[ac_cv_func_fetestexcept=yes], 
[ac_cv_func_fetestexcept=no])
+  AC_MSG_RESULT($ac_cv_func_fetestexcept)
+  if test x"$ac_cv_func_fetestexcept" = x"yes"; then
+    AC_DEFINE([HAVE_FETESTEXCEPT], [1],
+      [Define to 1 if you have the fetestexcept function.])
+  fi
+
 fi
 
 AC_CHECK_SIZEOF([time_t])
@@ -516,10 +618,9 @@
 AC_CHECK_FUNCS([clock_gettime closefrom ctermid])
 AC_CHECK_FUNCS([dup2])
 AC_CHECK_FUNCS([expm1])
-AC_CHECK_FUNCS([fcntl fdatasync feclearexcept fedisableexcept feenableexcept])
-AC_CHECK_FUNCS([fegetenv fegetexcept fegetexceptflag fegetround feholdexcept])
-AC_CHECK_FUNCS([feraiseexcept fesetenv fesetexceptflag fesetround])
-AC_CHECK_FUNCS([fetestexcept feupdateenv floor fpathconf frexp fpgetround])
+AC_CHECK_FUNCS([fcntl fdatasync fedisableexcept feenableexcept])
+AC_CHECK_FUNCS([fegetenv feholdexcept feraiseexcept])
+AC_CHECK_FUNCS([feupdateenv floor fpathconf frexp fpgetround])
 AC_CHECK_FUNCS([fpsetround fsync fsync_range ftruncate])
 AC_CHECK_FUNCS([getcwd gethostbyname gethostname getlogin getpagesize getpgrp])
 AC_CHECK_FUNCS([getpt gettimeofday getwd grantpt])
_______________________________________________
MIT-Scheme-users mailing list
MIT-Scheme-users@gnu.org
https://lists.gnu.org/mailman/listinfo/mit-scheme-users

Reply via email to