summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-05-09 17:53:53 +0200
committerwm4 <wm4@nowhere>2020-05-09 18:02:57 +0200
commita1812e2a46b61c431e5650e7aa38ac6cf1f0c934 (patch)
treea2bb77c082b2604fdc55f5aa5e1cb4a3507ad13a
parent9dfcc496a504f6ec701af08e92ce45b93239277f (diff)
downloadmpv-a1812e2a46b61c431e5650e7aa38ac6cf1f0c934.tar.bz2
mpv-a1812e2a46b61c431e5650e7aa38ac6cf1f0c934.tar.xz
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.
-rw-r--r--waftools/detections/compiler.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/waftools/detections/compiler.py b/waftools/detections/compiler.py
index 399a606144..06baa98ac0 100644
--- a/waftools/detections/compiler.py
+++ b/waftools/detections/compiler.py
@@ -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",