]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Pass the flat_namespace option to the linker
authorChristophe de Dinechin <dinechin@redhat.com>
Mon, 8 Aug 2022 18:14:08 +0000 (20:14 +0200)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 9 Aug 2022 09:42:45 +0000 (11:42 +0200)
This fixes vircryptotest on macOS 12 (Monterey).

The test relies on library injection (using DYLD_INSERT_LIBRARIES)
to replace the normal random functions with functions giving predictable
results, defined in virrandommock.c. However, using DYLD_INSERT_LIBRARIES
only works when building with flat namespaces.

Adding the -Wl,-flat_namespace option to the linker fixes the problem.
The option was already defined in the top-level meson.build, but had been
forgotten in the test linker arguments.

Signed-off-by: Christophe de Dinechin <dinechin@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tests/meson.build

index bc9d8ccc4c3152d66fa9032c760d165ff2d54057..d6b1bb2bf0eafb00238eac7e354e51d5d4b1ec11 100644 (file)
@@ -28,6 +28,7 @@ tests_dep = declare_dependency(
   ],
   link_args: (
     libvirt_export_dynamic
+    + libvirt_flat_namespace
     + coverage_flags
   ),
 )