build: add -fno-math-errno

glibc/gcc make certain math functions set errno by default. This is not
required by the standard, and makes everything complexer and slower
(well done glibc). It typically prevents inlining certain math functions
too, where the compiler can turn a function call to a single
instruction, such as observed with lrint().

So this has possibly some minor performance advantages, and no
disadvantages.
This commit is contained in:
wm4 2020-05-09 17:53:53 +02:00
parent 9dfcc496a5
commit a1812e2a46
1 changed files with 1 additions and 0 deletions

View File

@ -44,6 +44,7 @@ def __add_generic_flags__(ctx):
"-Wno-format-truncation",
"-Wimplicit-fallthrough",
])
__test_and_add_flags__(ctx, ["-fno-math-errno"])
def __add_gcc_flags__(ctx):
ctx.env.CFLAGS += ["-Wall", "-Wundef", "-Wmissing-prototypes", "-Wshadow",