From 5ab6d2853877b4c917343dc35a4a5e3009b60289 Mon Sep 17 00:00:00 2001 From: Paul Ramsey Date: Wed, 10 Jan 2024 14:06:45 -0800 Subject: [PATCH] Fix regression tests for AppleClang on ARM64 --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd210afb23..bf9590f65f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,20 @@ set(CMAKE_CXX_EXTENSIONS OFF) add_library(geos_cxx_flags INTERFACE) target_compile_features(geos_cxx_flags INTERFACE cxx_std_11) +#----------------------------------------------------------------------------- +# Add flags to prevent 'fused multiply-add' operations on targets (ARM64) +# that allow it, as it breaks calculations in DD.cpp. +# TODO: Replace DD calculations with 'long float' where target supports +# true long float, and remove other cases where FMA causes regression +# failures. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207 +#----------------------------------------------------------------------------- +target_compile_options(geos_cxx_flags INTERFACE + "$<$,$>:-ffp-contract=off>" + "$<$:-ffp-contract=off>" + "$<$:/fp:precise>" + ) + #----------------------------------------------------------------------------- # Target geos_cxx_flags: common compilation flags #-----------------------------------------------------------------------------