From: Matthew Fernandez Date: Wed, 12 Oct 2022 04:10:54 +0000 (-0700) Subject: stop enabling -ffast-math on any platform X-Git-Tag: 7.0.0~14^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=404e8aa21385d50b268d739fe39927ba02327af8;p=graphviz stop enabling -ffast-math on any platform The `-ffast-math` compiler option enables a mode of floating point semantics that are heavily relaxed from strict IEEE 754 conformance in the name of speed.¹ The permissible optimizations under `-ffast-math` include transformations that produce floating point results most users would consider wrong. It is unclear why “do math fast but incorrectly” is a useful mode. It seems the world is finally coming around to this tenet.² This change stops enabling `-ffast-math` anywhere in the Autotools build system. Gitlab: fixes #1412, #2296 Reported-by: Kasper Daniel Hansen Reported-by: Ross Barnowski ¹ https://gcc.gnu.org/wiki/FloatingPointMath ² https://simonbyrne.github.io/notes/fastmath/, https://moyix.blogspot.com/2022/09/someones-been-messing-with-my-subnormals.html --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 2a8265b46..c3cf7ddcb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 no longer suppresses `-ffast-math`. Users relying on this are encouraged to investigate what in their build environment is appending a flag their C compiler does not support. +- The `-ffast-math` compiler flag is no longer enabled by the Autotools build + system. + +### Fixed + +- Issues with GCC 8, `-O3` and `-ffast-math` #1412 +- Problem building Graphviz-5.0.1: undefined symbols `__*_finite` #2296 ### Removed diff --git a/configure.ac b/configure.ac index 49dd28cef..33febee1a 100644 --- a/configure.ac +++ b/configure.ac @@ -396,10 +396,10 @@ else LDFLAGS="${LDFLAGS} -Wl,-headerpad_max_install_names" ;; *-freebsd* ) - CFLAGS="${CFLAGS} -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math" + CFLAGS="${CFLAGS} -Wstrict-prototypes -Wpointer-arith -Wall" ;; * ) - CFLAGS="${CFLAGS} -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall -ffast-math" + CFLAGS="${CFLAGS} -Wno-unknown-pragmas -Wstrict-prototypes -Wpointer-arith -Wall" ;; esac ;;