mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-common
synced 2026-08-06 23:32:51 +00:00
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 used. Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com> Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
parent
35f45282d4
commit
03e1fb94e4
14
meson.build
14
meson.build
@ -83,15 +83,11 @@ foreach func : functions
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# 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
|
||||
# FIXME
|
||||
# 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
|
||||
endif
|
||||
|
||||
#
|
||||
|
||||
Loading…
Reference in New Issue
Block a user