[libvirt] [PATCH] tests: Fix systemd test with --without-driver-modules

Every test that makes use of virmock.h (only virsystemdtest as of now) needs to be linked with -export-dynamic to make sure the LD_PRELOADed mock library can access it's wrap_* symbols. Normally, DRIVER_MODULE_LDFLAGS variable contains -export-dynamic but when --without-driver-modules configure option is used, DRIVER_MODULE_LDFLAGS is empty. This patch turns on -export-dynamic for all tests unconditionally regardless on --without-driver-modules. This fixes virsystemdtest and all future users of virmock.h. Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/Makefile.am b/tests/Makefile.am index c5346d1..1e63b86 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -43,6 +43,9 @@ AM_CFLAGS = \ $(COVERAGE_CFLAGS) \ $(WARN_CFLAGS) +AM_LDFLAGS = \ + -export-dynamic + if WITH_DRIVER_MODULES INCLUDES += \ -DTEST_DRIVER_DIR=\"$(top_builddir)/src/.libs\" @@ -921,7 +924,6 @@ virsystemdtest_SOURCES = \ virsystemdtest.c testutils.h testutils.c virsystemdtest_CFLAGS = $(AM_CFLAGS) $(DBUS_CFLAGS) virsystemdtest_LDADD = $(LDADDS) -virsystemdtest_LDFLAGS = $(DRIVER_MODULE_LDFLAGS) else ! WITH_DBUS EXTRA_DIST += virdbustest.c virmockdbus.c virsystemdtest.c -- 1.9.2

On 04/10/2014 09:26 AM, Jiri Denemark wrote:
Every test that makes use of virmock.h (only virsystemdtest as of now) needs to be linked with -export-dynamic to make sure the LD_PRELOADed mock library can access it's wrap_* symbols. Normally, DRIVER_MODULE_LDFLAGS variable contains -export-dynamic but when --without-driver-modules configure option is used, DRIVER_MODULE_LDFLAGS is empty.
This patch turns on -export-dynamic for all tests unconditionally regardless on --without-driver-modules. This fixes virsystemdtest and all future users of virmock.h.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On Thu, Apr 10, 2014 at 11:02:02 -0600, Eric Blake wrote:
On 04/10/2014 09:26 AM, Jiri Denemark wrote:
Every test that makes use of virmock.h (only virsystemdtest as of now) needs to be linked with -export-dynamic to make sure the LD_PRELOADed mock library can access it's wrap_* symbols. Normally, DRIVER_MODULE_LDFLAGS variable contains -export-dynamic but when --without-driver-modules configure option is used, DRIVER_MODULE_LDFLAGS is empty.
This patch turns on -export-dynamic for all tests unconditionally regardless on --without-driver-modules. This fixes virsystemdtest and all future users of virmock.h.
Signed-off-by: Jiri Denemark <jdenemar@redhat.com> --- tests/Makefile.am | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
ACK.
Pushed, thanks. Jirka
participants (2)
-
Eric Blake
-
Jiri Denemark