diff options
author | Josef Ahmad <josef.ahmad@mongodb.com> | 2022-09-15 06:14:58 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-15 07:26:17 +0000 |
commit | d8901a2835d3f464d394631d85dc7aa9493fc095 (patch) | |
tree | 5d1caaa99f13a8903d28584874879c77689d2a68 /SConstruct | |
parent | a5ecbf2c6416309673afdbe3ff2f4280f4d03d43 (diff) | |
download | mongo-d8901a2835d3f464d394631d85dc7aa9493fc095.tar.gz |
SERVER-69611 Set the -ffp-contract=off compiler option by default
Diffstat (limited to 'SConstruct')
-rwxr-xr-x | SConstruct | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index ec37dea4ea4..77c2400c609 100755 --- a/SConstruct +++ b/SConstruct @@ -2478,6 +2478,15 @@ for suboption in get_option('experimental-runtime-hardening'): elif suboption.startswith('+'): selected_experimental_runtime_hardenings.add(suboption[1:]) +# Disable floating-point contractions such as forming of fused multiply-add operations. +if env.ToolchainIs('clang', 'gcc'): + env.Append(CCFLAGS=["-ffp-contract=off"]) +else: + # msvc defaults to /fp:precise. Visual Studio 2022 does not emit floating-point contractions + # with /fp:precise, but previous versions can. Disable contractions altogether by using + # /fp:strict. + env.Append(CCFLAGS=["/fp:strict"]) + if env.TargetOSIs('linux'): env.Append(LIBS=["m"]) if not env.TargetOSIs('android'): |