Hi Dave, I just opened a merge request at https://gitlab.com/embeddable-common-lisp/ecl/merge_requests/177 based on your idea for detecting floating point exceptions. It containts also a new check in the configure script that should detect cases where feenableexcept is declared but the CPU doesn't generate floating point exceptions. Could you test whether these changes solve the problems you reported? Best regards, Marius Gerbershagen Am 31.12.19 um 23:10 schrieb Dave Richards:
The FPU on the Raspberry Pi does not generate CPUexceptions, which prevents Linux from generating SIGFPE signals, which prevents ECL from detecting floating-point errors and delivering appropriate error conditions. The patch below causes ECL to poll for floating-point errors (rather than relying on SIGFPEs). This situation is properly detected by 'make check'.
diff --git a/src/aclocal.m4 b/src/aclocal.m4 index d1e626a7..ffcd1ad3 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -865,6 +865,10 @@ case "${host_cpu}" in ECL_FPE_CODE="arch/fpe_x86.c" AC_MSG_RESULT([x86_64]) ;; + arm* ) + ECL_FPE_CODE="arch/fpe_fenv.c" + AC_MSG_RESULT([arm]) + ;; *) ECL_FPE_CODE="arch/fpe_none.c" AC_MSG_RESULT([not available])
(src/configure needs to be re-generated.)
Add the file src/c/arch/fpe_fenv.c:
/* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*- */ /* vim: set filetype=c tabstop=8 shiftwidth=4 expandtab: */
/* fpe_fenv.c -- ISO C99 version of the floating point code */ /* Copyright (c) 2005, Juan Jose Garcia Ripoll.
ECL is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
See file '../Copyright' for full details. */
/* * See fpe_none.c for a description */
#define ecl_detect_fpe() do { \ int bits = fetestexcept(FE_ALL_EXCEPT); \ unlikely_if (bits) ecl_deliver_fpe(bits); } while(0)