[Spice-commits] meson.build

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Feb 27 14:41:49 UTC 2020

 meson.build |   14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

New commits:
commit 03e1fb94e445ffd43f82c26de91809e3d8e7480d
Author: Eduardo Lima (Etrunko) <etrunko at redhat.com>
Date:   Fri Feb 7 10:59:01 2020 -0300

    build: Unconditionally link with libm if found
    New versions of gcc have implemented __has_builtin which causes meson
    to detect functions in libm, such as hypot() and sqrt() as built-ins
    during configure time, while they are actually part of libm. This has
    been causing build failures in Fedora 32 Rawhide and has been reported
    in meson for some time now: https://github.com/mesonbuild/meson/issues/3740
    Meson always adds --as-needed to linker arguments so, it does not hurt
    to link against libm even though no functions from that library will be
    Signed-off-by: Eduardo Lima (Etrunko) <etrunko at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/meson.build b/meson.build
index fd6133b..11e2765 100644
--- a/meson.build
+++ b/meson.build
@@ -83,15 +83,11 @@ foreach func : functions
-# check for hypot function
-# Include math.h header to avoid problems with builtins.
-# In some systems the function is in libm.
-if not compiler.has_function('hypot', prefix : '#include <math.h>')
-  libm = compiler.find_library('m', required : false)
-  if compiler.has_function('hypot', prefix : '#include <math.h>', dependencies : libm)
-    spice_common_deps += libm
-  endif
+# check for libm, as workaround for https://github.com/mesonbuild/meson/issues/3740
+libm = compiler.find_library('m', required : false)
+if libm.found()
+  spice_common_deps += libm

More information about the Spice-commits mailing list