From 3e597dee1128db8907a2b757c675c41cfdbf21aa Mon Sep 17 00:00:00 2001 From: Arvind Sankar Date: Mon, 6 Jul 2020 16:01:29 -0400 Subject: Use abs_top_builddir when referencing libraries libtool stores absolute paths in the dependency_libs component of the .la files. If the Makefile for a dependent library refers to the libraries by relative path, some libraries end up duplicated on the link command line. As an example, libzfs specifies libzfs_core, libnvpair and libuutil as dependencies to be linked in. The .la file for libzfs_core also specifies libnvpair, but using an absolute path, with the result that libnvpair is present twice in the linker command line for producing libzfs. While the only thing this causes is to slightly slow down the linking, we can avoid it by using absolute paths everywhere, including for convenience libraries just for consistency. Reviewed-by: Brian Behlendorf Signed-off-by: Arvind Sankar Closes #10538 --- tests/zfs-tests/cmd/btree_test/Makefile.am | 4 ++-- tests/zfs-tests/cmd/libzfs_input_check/Makefile.am | 4 ++-- tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'tests/zfs-tests/cmd') diff --git a/tests/zfs-tests/cmd/btree_test/Makefile.am b/tests/zfs-tests/cmd/btree_test/Makefile.am index 55c40e3f5..0bb8f9917 100644 --- a/tests/zfs-tests/cmd/btree_test/Makefile.am +++ b/tests/zfs-tests/cmd/btree_test/Makefile.am @@ -28,5 +28,5 @@ pkgexec_PROGRAMS = btree_test btree_test_SOURCES = btree_test.c btree_test_LDADD = \ - $(top_builddir)/lib/libzpool/libzpool.la \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la + $(abs_top_builddir)/lib/libzpool/libzpool.la \ + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la diff --git a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am index 67fa98886..ba02f93fe 100644 --- a/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am +++ b/tests/zfs-tests/cmd/libzfs_input_check/Makefile.am @@ -6,5 +6,5 @@ pkgexec_PROGRAMS = libzfs_input_check libzfs_input_check_SOURCES = libzfs_input_check.c libzfs_input_check_LDADD = \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la \ - $(top_builddir)/lib/libnvpair/libnvpair.la + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la diff --git a/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am b/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am index c98e032e1..511b6c691 100644 --- a/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am +++ b/tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am @@ -6,5 +6,5 @@ pkgexec_PROGRAMS = nvlist_to_lua nvlist_to_lua_SOURCES = nvlist_to_lua.c nvlist_to_lua_LDADD = \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la \ - $(top_builddir)/lib/libnvpair/libnvpair.la + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la -- cgit v1.2.3