meson: Don't attempt to use version scripts on macOS

macOS libraries don't support symbol versioning, so the only
result that we achieve by passing additional flags to the linker
is a bunch of messages like

  ld: warning: ignoring file .../libvirt/build/src/libvirt.syms,
  building for macOS-x86_64 but attempting to link with file built
  for unknown-unsupported file format ( 0x23 0x20 0x57 0x41 ... )

being produced during the build.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani
2022-05-05 15:29:00 +02:00
parent fac80100c0
commit b05dfcdfcb
4 changed files with 47 additions and 30 deletions

View File

@@ -510,6 +510,9 @@ libvirt_no_indirect = cc.get_supported_link_arguments([
if host_machine.system() == 'windows'
version_script_flags = '-Wl,'
elif host_machine.system() == 'darwin'
# macOS libraries don't support symbol versioning
version_script_flags = ''
else
test_file = '@0@/src/libvirt_qemu.syms'.format(meson.source_root())
if cc.has_link_argument('-Wl,--version-script=@0@'.format(test_file))