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 --- lib/libnvpair/Makefile.am | 2 +- lib/libuutil/Makefile.am | 4 ++-- lib/libzfs/Makefile.am | 8 ++++---- lib/libzfs_core/Makefile.am | 4 ++-- lib/libzpool/Makefile.am | 8 ++++---- lib/libzutil/Makefile.am | 8 ++++---- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'lib') diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am index 8d736f7b7..340e6d362 100644 --- a/lib/libnvpair/Makefile.am +++ b/lib/libnvpair/Makefile.am @@ -27,7 +27,7 @@ nodist_libnvpair_la_SOURCES = \ $(KERNEL_C) libnvpair_la_LIBADD = \ - $(top_builddir)/lib/libspl/libspl_assert.la + $(abs_top_builddir)/lib/libspl/libspl_assert.la libnvpair_la_LIBADD += $(LIBTIRPC_LIBS) $(LTLIBINTL) diff --git a/lib/libuutil/Makefile.am b/lib/libuutil/Makefile.am index 099446ca2..4143a190b 100644 --- a/lib/libuutil/Makefile.am +++ b/lib/libuutil/Makefile.am @@ -16,8 +16,8 @@ USER_C = \ libuutil_la_SOURCES = $(USER_C) libuutil_la_LIBADD = \ - $(top_builddir)/lib/libavl/libavl.la \ - $(top_builddir)/lib/libspl/libspl.la + $(abs_top_builddir)/lib/libavl/libavl.la \ + $(abs_top_builddir)/lib/libspl/libspl.la libuutil_la_LIBADD += $(LTLIBINTL) diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index 5a421409c..1f7e3c5ee 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -73,13 +73,13 @@ libzfs_la_LIBADD = if BUILD_LINUX libzfs_la_LIBADD += \ - $(top_builddir)/lib/libshare/libshare.la + $(abs_top_builddir)/lib/libshare/libshare.la endif libzfs_la_LIBADD += \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la \ - $(top_builddir)/lib/libnvpair/libnvpair.la \ - $(top_builddir)/lib/libuutil/libuutil.la + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la \ + $(abs_top_builddir)/lib/libuutil/libuutil.la libzfs_la_LIBADD += -lm $(LIBCRYPTO_LIBS) $(ZLIB_LIBS) $(LTLIBINTL) diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am index 75b46acde..94a10e399 100644 --- a/lib/libzfs_core/Makefile.am +++ b/lib/libzfs_core/Makefile.am @@ -10,8 +10,8 @@ USER_C = \ libzfs_core_la_SOURCES = $(USER_C) libzfs_core_la_LIBADD = \ - $(top_builddir)/lib/libzutil/libzutil.la \ - $(top_builddir)/lib/libnvpair/libnvpair.la + $(abs_top_builddir)/lib/libzutil/libzutil.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la libzfs_core_la_LIBADD += $(LTLIBINTL) diff --git a/lib/libzpool/Makefile.am b/lib/libzpool/Makefile.am index 6cbab8fee..6256d5e73 100644 --- a/lib/libzpool/Makefile.am +++ b/lib/libzpool/Makefile.am @@ -200,10 +200,10 @@ nodist_libzpool_la_SOURCES = \ $(LUA_C) libzpool_la_LIBADD = \ - $(top_builddir)/lib/libicp/libicp.la \ - $(top_builddir)/lib/libunicode/libunicode.la \ - $(top_builddir)/lib/libzfs_core/libzfs_core.la \ - $(top_builddir)/lib/libnvpair/libnvpair.la + $(abs_top_builddir)/lib/libicp/libicp.la \ + $(abs_top_builddir)/lib/libunicode/libunicode.la \ + $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \ + $(abs_top_builddir)/lib/libnvpair/libnvpair.la libzpool_la_LIBADD += $(LIBCLOCK_GETTIME) $(ZLIB_LIBS) -ldl diff --git a/lib/libzutil/Makefile.am b/lib/libzutil/Makefile.am index af1911760..bbd69b780 100644 --- a/lib/libzutil/Makefile.am +++ b/lib/libzutil/Makefile.am @@ -32,13 +32,13 @@ endif libzutil_la_SOURCES = $(USER_C) libzutil_la_LIBADD = \ - $(top_builddir)/lib/libavl/libavl.la \ - $(top_builddir)/lib/libtpool/libtpool.la \ - $(top_builddir)/lib/libspl/libspl.la + $(abs_top_builddir)/lib/libavl/libavl.la \ + $(abs_top_builddir)/lib/libtpool/libtpool.la \ + $(abs_top_builddir)/lib/libspl/libspl.la if BUILD_LINUX libzutil_la_LIBADD += \ - $(top_builddir)/lib/libefi/libefi.la + $(abs_top_builddir)/lib/libefi/libefi.la endif libzutil_la_LIBADD += -lm $(LIBBLKID_LIBS) $(LIBUDEV_LIBS) -- cgit v1.2.3