[libvirt] [PATCH 11/11] tests: Make references to global symbols indirect in test drivers

Roman Bolshakov posted 11 patches 6 years, 5 months ago
[libvirt] [PATCH 11/11] tests: Make references to global symbols indirect in test drivers
Posted by Roman Bolshakov 6 years, 5 months ago
A library has to be built with -flat_namespace to get all references to
global symbols indirected. That can also be achieved with two-level
namespace interposition but we're not using explicit symbol
interposition since it's more verbose and requires massive changes to
the mocks.

This provides a way to interpose a mock for virQEMUCapsProbeHostCPU from
qemucpumock and fixes domaincapstest on macOS.

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
---
 tests/Makefile.am | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 460efb6b7b..f92710db43 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -56,6 +56,9 @@ DRIVERLIB_LDFLAGS = \
 	-avoid-version \
 	-rpath /evil/libtool/hack/to/force/shared/lib/creation \
 	$(MINGW_EXTRA_LDFLAGS)
+if WITH_MACOS
+DRIVERLIB_LDFLAGS += -Wl,-flat_namespace
+endif WITH_MACOS
 
 PROBES_O =
 if WITH_DTRACE_PROBES
-- 
2.22.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 11/11] tests: Make references to global symbols indirect in test drivers
Posted by Daniel P. Berrangé 6 years, 5 months ago
On Wed, Aug 21, 2019 at 07:13:23PM +0300, Roman Bolshakov wrote:
> A library has to be built with -flat_namespace to get all references to
> global symbols indirected. That can also be achieved with two-level
> namespace interposition but we're not using explicit symbol
> interposition since it's more verbose and requires massive changes to
> the mocks.
> 
> This provides a way to interpose a mock for virQEMUCapsProbeHostCPU from
> qemucpumock and fixes domaincapstest on macOS.
> 
> Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
> ---
>  tests/Makefile.am | 3 +++
>  1 file changed, 3 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list