From c273496d1852bef725092cbc44295221823edc49 Mon Sep 17 00:00:00 2001 From: Juan Carlos Date: Thu, 6 Oct 2022 02:19:41 -0300 Subject: Add no-math-errno for GCC when build for Release (#20503) * gcc matherrno * changelog --- config/nim.cfg | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/nim.cfg b/config/nim.cfg index de525ae92..47bc78ba5 100644 --- a/config/nim.cfg +++ b/config/nim.cfg @@ -250,14 +250,17 @@ clang.objc.options.linker = "-lobjc -lgnustep-base" gcc.options.linker %= "-L $WIND_BASE/target/lib/usr/lib/ppc/PPC32/common -mrtp -fno-strict-aliasing -D_C99 -D_HAS_C9X -std=c99 -fasm -Wall -Wno-write-strings" @end -gcc.options.speed = "-O3 -fno-strict-aliasing -fno-ident" +# -fno-math-errno is default in OSX, iOS, BSD, Musl, Libm, LLVM, Clang, ICC. +# See https://itnext.io/why-standard-c-math-functions-are-slow-d10d02554e33 +# and https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Optimize-Options.html#Optimize-Options +gcc.options.speed = "-O3 -fno-strict-aliasing -fno-ident -fno-math-errno" gcc.options.size = "-Os -fno-ident" @if windows: gcc.options.debug = "-g3 -Og -gdwarf-3" @else: gcc.options.debug = "-g3 -Og" @end -gcc.cpp.options.speed = "-O3 -fno-strict-aliasing -fno-ident" +gcc.cpp.options.speed = "-O3 -fno-strict-aliasing -fno-ident -fno-math-errno" gcc.cpp.options.size = "-Os -fno-ident" gcc.cpp.options.debug = "-g3 -Og" #passl = "-pg" -- cgit 1.4.1-2-gfad0