From a1812e2a46b61c431e5650e7aa38ac6cf1f0c934 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 9 May 2020 17:53:53 +0200 Subject: 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. --- waftools/detections/compiler.py | 1 + 1 file changed, 1 insertion(+) 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", -- cgit v1.2.3