[libvirt] [PATCH] storage: fix sheepdog driver / test linking to avoid duplicating source

Daniel P. Berrangé posted 1 patch 6 years, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/20180227113019.30696-1-berrange@redhat.com
Test syntax-check passed
src/Makefile.am   | 3 +--
tests/Makefile.am | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
[libvirt] [PATCH] storage: fix sheepdog driver / test linking to avoid duplicating source
Posted by Daniel P. Berrangé 6 years, 1 month ago
The libvirt_storage_backend_sheepdog_priv.la library depends on symbols
provided in the libvirt_driver_storage_impl.la library. As such the
latter must be listed 2nd when passed to the linker to avoid symbol
resolution problems. This mistake is being masked by the sheepdog
driver linking in a second copy of the storage driver code. Remove
this duplicate linkage of backend source and fix the test link order.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/Makefile.am   | 3 +--
 tests/Makefile.am | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index d3a01dbbe7..8d72f2f1e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1359,8 +1359,7 @@ libvirt_storage_backend_sheepdog_la_CFLAGS = \
 	$(AM_CFLAGS)
 
 libvirt_storage_backend_sheepdog_priv_la_SOURCES = \
-	$(STORAGE_DRIVER_SHEEPDOG_SOURCES) \
-	$(STORAGE_DRIVER_BACKEND_SOURCES)
+	$(STORAGE_DRIVER_SHEEPDOG_SOURCES)
 libvirt_storage_backend_sheepdog_priv_la_CFLAGS = \
 	-I$(srcdir)/conf \
 	$(AM_CFLAGS)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 09647a959d..d794df3e5c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -842,8 +842,8 @@ storagebackendsheepdogtest_SOURCES = \
 	storagebackendsheepdogtest.c \
 	testutils.c testutils.h
 storagebackendsheepdogtest_LDADD = \
-	../src/libvirt_driver_storage_impl.la \
 	../src/libvirt_storage_backend_sheepdog_priv.la \
+	../src/libvirt_driver_storage_impl.la \
 	$(LDADDS)
 else ! WITH_STORAGE_SHEEPDOG
 EXTRA_DIST += storagebackendsheepdogtest.c
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] storage: fix sheepdog driver / test linking to avoid duplicating source
Posted by Michal Privoznik 6 years, 1 month ago
On 02/27/2018 12:30 PM, Daniel P. Berrangé wrote:
> The libvirt_storage_backend_sheepdog_priv.la library depends on symbols
> provided in the libvirt_driver_storage_impl.la library. As such the
> latter must be listed 2nd when passed to the linker to avoid symbol
> resolution problems. This mistake is being masked by the sheepdog
> driver linking in a second copy of the storage driver code. Remove
> this duplicate linkage of backend source and fix the test link order.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/Makefile.am   | 3 +--
>  tests/Makefile.am | 2 +-
>  2 files changed, 2 insertions(+), 3 deletions(-)

ACK and safe for freeze.

Michal

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