diff -Nru ecl-20.4.24+ds/debian/changelog ecl-20.4.24+ds/debian/changelog --- ecl-20.4.24+ds/debian/changelog 2020-08-30 09:28:45.000000000 +0000 +++ ecl-20.4.24+ds/debian/changelog 2020-10-31 11:07:11.000000000 +0000 @@ -1,3 +1,10 @@ +ecl (20.4.24+ds-2) unstable; urgency=medium + + * Add prevent-floating-point-exception.patch, fixing spurious SIGFPE's + on ppc64el and ppc64. + + -- Tobias Hansen Sat, 31 Oct 2020 11:07:11 +0000 + ecl (20.4.24+ds-1) unstable; urgency=medium * New upstream release. diff -Nru ecl-20.4.24+ds/debian/patches/prevent-floating-point-exception.patch ecl-20.4.24+ds/debian/patches/prevent-floating-point-exception.patch --- ecl-20.4.24+ds/debian/patches/prevent-floating-point-exception.patch 1970-01-01 00:00:00.000000000 +0000 +++ ecl-20.4.24+ds/debian/patches/prevent-floating-point-exception.patch 2020-10-31 11:06:58.000000000 +0000 @@ -0,0 +1,44 @@ +From cdb602e40de866058aea37e47f886e026b87dd99 Mon Sep 17 00:00:00 2001 +From: Marius Gerbershagen +Date: Sat, 31 Oct 2020 11:34:28 +0100 +Subject: [PATCH] fpe: prevent spurious floating point exceptions in + WITH_LISP_FPE + +feenableexcept may generate a SIGFPE signal if exception status flags +are not cleared beforehand. Happens for example on powerpc platforms. + +Fixes #612. +--- + src/doc/manual/user-guide/embedding.txi | 3 +-- + src/h/impl/math_fenv.h | 4 ++-- + 2 files changed, 3 insertions(+), 4 deletions(-) + +--- a/src/doc/manual/user-guide/embedding.txi ++++ b/src/doc/manual/user-guide/embedding.txi +@@ -258,8 +258,7 @@ + later restoring the floating point environment of surrounding C code + so that changes in the floating point environment don't leak outside. + +-@coderef{ECL_WITH_LISP_FPE} can be also used before ECL has booted or +-before an external thread has been imported. ++@coderef{ECL_WITH_LISP_FPE} can be also used before ECL has booted. + + @exindex Safely executing Lisp code with floating point exceptions in embedding program + @paragraph Example +--- a/src/h/impl/math_fenv.h ++++ b/src/h/impl/math_fenv.h +@@ -75,12 +75,12 @@ + # define ECL_WITH_LISP_FPE_BEGIN do { \ + fenv_t __fenv; \ + fegetenv(&__fenv); \ ++ feclearexcept(FE_ALL_EXCEPT); \ + if (ecl_get_option(ECL_OPT_BOOTED) > 0) { \ + int bits = ecl_process_env()->trap_fpe_bits; \ + fedisableexcept(FE_ALL_EXCEPT & ~bits); \ + feenableexcept(FE_ALL_EXCEPT & bits); \ +- } \ +- feclearexcept(FE_ALL_EXCEPT); ++ } + # else + # define ECL_WITH_LISP_FPE_BEGIN do { \ + fenv_t __fenv; \ diff -Nru ecl-20.4.24+ds/debian/patches/series ecl-20.4.24+ds/debian/patches/series --- ecl-20.4.24+ds/debian/patches/series 2020-08-30 08:53:17.000000000 +0000 +++ ecl-20.4.24+ds/debian/patches/series 2020-10-31 11:06:22.000000000 +0000 @@ -6,3 +6,4 @@ 215.patch ECL_WITH_LISP_FPE.patch ecl.info-max-compression.patch +prevent-floating-point-exception.patch