Add no-math-errno for GCC when build for Release (#20503)

* gcc matherrno
* changelog
This commit is contained in:
Juan Carlos 2022-10-06 02:19:41 -03:00 • committed by GitHub
commit c273496d18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 4 deletions

View file

@ -221,6 +221,8 @@
related functions produced on the backend. This prevents conflicts with other Nim related functions produced on the backend. This prevents conflicts with other Nim
static libraries. static libraries.
- When compiling for Release the flag `-fno-math-errno` is used for GCC.
## Tool changes ## Tool changes

View file

@ -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" 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 @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" gcc.options.size = "-Os -fno-ident"
@if windows: @if windows:
gcc.options.debug = "-g3 -Og -gdwarf-3" gcc.options.debug = "-g3 -Og -gdwarf-3"
@else: @else:
gcc.options.debug = "-g3 -Og" gcc.options.debug = "-g3 -Og"
@end @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.size = "-Os -fno-ident"
gcc.cpp.options.debug = "-g3 -Og" gcc.cpp.options.debug = "-g3 -Og"
#passl = "-pg" #passl = "-pg"