aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2018-07-08 10:51:00 -0700
committerPaul Eggert2018-07-08 10:52:12 -0700
commit848f0f73e98dfa8f32ffbcf7c2e0ea37ce123959 (patch)
treeca009abf3b079e32c9004df08fbb8e02562db347
parent65889a6d127fcbbbdc1e74d26036e91bd24d1405 (diff)
downloademacs-848f0f73e98dfa8f32ffbcf7c2e0ea37ce123959.tar.gz
emacs-848f0f73e98dfa8f32ffbcf7c2e0ea37ce123959.zip
Fix floating point exceptions on Alpha (Bug#32086)
Backport from master. * admin/merge-gnulib (GNULIB_MODULES): Add fpieee. * m4/fpieee.m4: New file, copied from Gnulib. * m4/gnulib-comp.m4: Regenerate.
-rwxr-xr-xadmin/merge-gnulib2
-rw-r--r--lib/gnulib.mk.in2
-rw-r--r--m4/fpieee.m454
-rw-r--r--m4/gnulib-comp.m43
4 files changed, 59 insertions, 2 deletions
diff --git a/admin/merge-gnulib b/admin/merge-gnulib
index 42edfbbd367..b23adc26fb2 100755
--- a/admin/merge-gnulib
+++ b/admin/merge-gnulib
@@ -33,7 +33,7 @@ GNULIB_MODULES='
33 d-type diffseq dtoastr dtotimespec dup2 33 d-type diffseq dtoastr dtotimespec dup2
34 environ execinfo explicit_bzero faccessat 34 environ execinfo explicit_bzero faccessat
35 fcntl fcntl-h fdatasync fdopendir 35 fcntl fcntl-h fdatasync fdopendir
36 filemode filevercmp flexmember fstatat fsync 36 filemode filevercmp flexmember fpieee fstatat fsync
37 getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog 37 getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog
38 ignore-value intprops largefile lstat 38 ignore-value intprops largefile lstat
39 manywarnings memrchr minmax mkostemp mktime nstrftime 39 manywarnings memrchr minmax mkostemp mktime nstrftime
diff --git a/lib/gnulib.mk.in b/lib/gnulib.mk.in
index 71c01e3e2a2..e69ae45bb53 100644
--- a/lib/gnulib.mk.in
+++ b/lib/gnulib.mk.in
@@ -21,7 +21,7 @@
21# the same distribution terms as the rest of that program. 21# the same distribution terms as the rest of that program.
22# 22#
23# Generated by gnulib-tool. 23# Generated by gnulib-tool.
24# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings 24# Reproduce by: gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --avoid=close --avoid=dup --avoid=fchdir --avoid=fstat --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow --avoid=openat-die --avoid=opendir --avoid=raise --avoid=save-cwd --avoid=select --avoid=setenv --avoid=sigprocmask --avoid=stat --avoid=stdarg --avoid=stdbool --avoid=threadlib --avoid=tzset --avoid=unsetenv --avoid=utime --avoid=utime-h --gnu-make --makefile-name=gnulib.mk.in --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files alloca-opt binary-io byteswap c-ctype c-strcase careadlinkat close-stream count-leading-zeros count-one-bits count-trailing-zeros crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512 d-type diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat fcntl fcntl-h fdatasync fdopendir filemode filevercmp flexmember fpieee fstatat fsync getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog ignore-value intprops largefile lstat manywarnings memrchr minmax mkostemp mktime nstrftime pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat sig2str socklen stat-time std-gnu11 stdalign stddef stdio stpcpy strtoimax symlink sys_stat sys_time tempname time time_r time_rz timegm timer-time timespec-add timespec-sub unlocked-io update-copyright utimens vla warnings
25 25
26 26
27MOSTLYCLEANFILES += core *.stackdump 27MOSTLYCLEANFILES += core *.stackdump
diff --git a/m4/fpieee.m4 b/m4/fpieee.m4
new file mode 100644
index 00000000000..b58840f789d
--- /dev/null
+++ b/m4/fpieee.m4
@@ -0,0 +1,54 @@
1# fpieee.m4 serial 2 -*- coding: utf-8 -*-
2dnl Copyright (C) 2007, 2009-2018 Free Software Foundation, Inc.
3dnl This file is free software; the Free Software Foundation
4dnl gives unlimited permission to copy and/or distribute it,
5dnl with or without modifications, as long as this notice is preserved.
6
7dnl IEEE 754 standardized three items:
8dnl - The formats of single-float and double-float - nowadays commonly
9dnl available as 'float' and 'double' in C and C++.
10dnl No autoconf test needed.
11dnl - The overflow and division by zero behaviour: The result are values
12dnl '±Inf' and 'NaN', rather than exceptions as it was before.
13dnl This file provides an autoconf macro for ensuring this behaviour of
14dnl floating-point operations.
15dnl - A set of conditions (overflow, underflow, inexact, etc.) which can
16dnl be configured to trigger an exception.
17dnl This cannot be done in a portable way: it depends on the compiler,
18dnl libc, kernel, and CPU. No autoconf macro is provided for this.
19
20dnl Ensure non-trapping behaviour of floating-point overflow and
21dnl floating-point division by zero.
22dnl (For integer overflow, see gcc's -ftrapv option; for integer division by
23dnl zero, see the autoconf macro in intdiv0.m4.)
24
25AC_DEFUN([gl_FP_IEEE],
26[
27 AC_REQUIRE([AC_PROG_CC])
28 AC_REQUIRE([AC_CANONICAL_HOST])
29 # IEEE behaviour is the default on all CPUs except Alpha and SH
30 # (according to the test results of Bruno Haible's ieeefp/fenv_default.m4
31 # and the GCC 4.1.2 manual).
32 case "$host_cpu" in
33 alpha*)
34 # On Alpha systems, a compiler option provides the behaviour.
35 # See the ieee(3) manual page, also available at
36 # <https://backdrift.org/man/tru64/man3/ieee.3.html>
37 if test -n "$GCC"; then
38 # GCC has the option -mieee.
39 # For full IEEE compliance (rarely needed), use option -mieee-with-inexact.
40 CPPFLAGS="$CPPFLAGS -mieee"
41 else
42 # Compaq (ex-DEC) C has the option -ieee, equivalent to -ieee_with_no_inexact.
43 # For full IEEE compliance (rarely needed), use option -ieee_with_inexact.
44 CPPFLAGS="$CPPFLAGS -ieee"
45 fi
46 ;;
47 sh*)
48 if test -n "$GCC"; then
49 # GCC has the option -mieee.
50 CPPFLAGS="$CPPFLAGS -mieee"
51 fi
52 ;;
53 esac
54])
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4
index 167356faed4..e30ff1f828f 100644
--- a/m4/gnulib-comp.m4
+++ b/m4/gnulib-comp.m4
@@ -86,6 +86,8 @@ AC_DEFUN([gl_EARLY],
86 # Code from module filevercmp: 86 # Code from module filevercmp:
87 # Code from module flexmember: 87 # Code from module flexmember:
88 # Code from module fpending: 88 # Code from module fpending:
89 # Code from module fpieee:
90 AC_REQUIRE([gl_FP_IEEE])
89 # Code from module fstatat: 91 # Code from module fstatat:
90 # Code from module fsync: 92 # Code from module fsync:
91 # Code from module getdtablesize: 93 # Code from module getdtablesize:
@@ -994,6 +996,7 @@ AC_DEFUN([gl_FILE_LIST], [
994 m4/filemode.m4 996 m4/filemode.m4
995 m4/flexmember.m4 997 m4/flexmember.m4
996 m4/fpending.m4 998 m4/fpending.m4
999 m4/fpieee.m4
997 m4/fstatat.m4 1000 m4/fstatat.m4
998 m4/fsync.m4 1001 m4/fsync.m4
999 m4/getdtablesize.m4 1002 m4/getdtablesize.m4