summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArvind Sankar <[email protected]>2020-07-06 16:01:29 -0400
committerBrian Behlendorf <[email protected]>2020-07-10 14:26:32 -0700
commit3e597dee1128db8907a2b757c675c41cfdbf21aa (patch)
tree4854f380b44a21feb9fb9e2dc0664da2d9868db1
parentaf6591622696bcb4e46702da07923e909db99f30 (diff)
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 <[email protected]> Signed-off-by: Arvind Sankar <[email protected]> Closes #10538
-rw-r--r--cmd/mount_zfs/Makefile.am6
-rw-r--r--cmd/raidz_test/Makefile.am4
-rw-r--r--cmd/zdb/Makefile.am6
-rw-r--r--cmd/zed/Makefile.am8
-rw-r--r--cmd/zfs/Makefile.am8
-rw-r--r--cmd/zfs_ids_to_path/Makefile.am2
-rw-r--r--cmd/zhack/Makefile.am6
-rw-r--r--cmd/zinject/Makefile.am6
-rw-r--r--cmd/zpool/Makefile.am8
-rw-r--r--cmd/zstream/Makefile.am6
-rw-r--r--cmd/ztest/Makefile.am6
-rw-r--r--contrib/pam_zfs_key/Makefile.am8
-rw-r--r--lib/libnvpair/Makefile.am2
-rw-r--r--lib/libuutil/Makefile.am4
-rw-r--r--lib/libzfs/Makefile.am8
-rw-r--r--lib/libzfs_core/Makefile.am4
-rw-r--r--lib/libzpool/Makefile.am8
-rw-r--r--lib/libzutil/Makefile.am8
-rw-r--r--tests/zfs-tests/cmd/btree_test/Makefile.am4
-rw-r--r--tests/zfs-tests/cmd/libzfs_input_check/Makefile.am4
-rw-r--r--tests/zfs-tests/cmd/nvlist_to_lua/Makefile.am4
-rw-r--r--tests/zfs-tests/tests/functional/checksum/Makefile.am4
-rw-r--r--tests/zfs-tests/tests/functional/hkdf/Makefile.am2
-rw-r--r--tests/zfs-tests/tests/functional/libzfs/Makefile.am2
24 files changed, 64 insertions, 64 deletions
diff --git a/cmd/mount_zfs/Makefile.am b/cmd/mount_zfs/Makefile.am
index ed3208a9a..6c4d6ff79 100644
--- a/cmd/mount_zfs/Makefile.am
+++ b/cmd/mount_zfs/Makefile.am
@@ -13,8 +13,8 @@ mount_zfs_SOURCES = \
mount_zfs.c
mount_zfs_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzfs/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
mount_zfs_LDADD += $(LTLIBINTL)
diff --git a/cmd/raidz_test/Makefile.am b/cmd/raidz_test/Makefile.am
index 387cc7d8a..ccfa7019c 100644
--- a/cmd/raidz_test/Makefile.am
+++ b/cmd/raidz_test/Makefile.am
@@ -14,7 +14,7 @@ raidz_test_SOURCES = \
raidz_bench.c
raidz_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
raidz_test_LDADD += -lm
diff --git a/cmd/zdb/Makefile.am b/cmd/zdb/Makefile.am
index 68de8ea3c..7a29e54f6 100644
--- a/cmd/zdb/Makefile.am
+++ b/cmd/zdb/Makefile.am
@@ -11,6 +11,6 @@ zdb_SOURCES = \
zdb.h
zdb_LDADD = \
- $(top_builddir)/lib/libzpool/libzpool.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzpool/libzpool.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/cmd/zed/Makefile.am b/cmd/zed/Makefile.am
index 89b4d899b..4bd8ac4a5 100644
--- a/cmd/zed/Makefile.am
+++ b/cmd/zed/Makefile.am
@@ -38,10 +38,10 @@ FMA_SRC = \
zed_SOURCES = $(ZED_SRC) $(FMA_SRC)
zed_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(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/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la \
+ $(abs_top_builddir)/lib/libuutil/libuutil.la
zed_LDADD += -lrt $(LIBUDEV_LIBS) $(LIBUUID_LIBS)
zed_LDFLAGS = -pthread
diff --git a/cmd/zfs/Makefile.am b/cmd/zfs/Makefile.am
index 5c73477d2..dec592038 100644
--- a/cmd/zfs/Makefile.am
+++ b/cmd/zfs/Makefile.am
@@ -11,10 +11,10 @@ zfs_SOURCES = \
zfs_projectutil.h
zfs_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(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/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la \
+ $(abs_top_builddir)/lib/libuutil/libuutil.la
zfs_LDADD += $(LTLIBINTL)
diff --git a/cmd/zfs_ids_to_path/Makefile.am b/cmd/zfs_ids_to_path/Makefile.am
index c509a3862..176eeb3c7 100644
--- a/cmd/zfs_ids_to_path/Makefile.am
+++ b/cmd/zfs_ids_to_path/Makefile.am
@@ -6,4 +6,4 @@ zfs_ids_to_path_SOURCES = \
zfs_ids_to_path.c
zfs_ids_to_path_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la
+ $(abs_top_builddir)/lib/libzfs/libzfs.la
diff --git a/cmd/zhack/Makefile.am b/cmd/zhack/Makefile.am
index 3f6ef1215..6c5b5d096 100644
--- a/cmd/zhack/Makefile.am
+++ b/cmd/zhack/Makefile.am
@@ -6,6 +6,6 @@ zhack_SOURCES = \
zhack.c
zhack_LDADD = \
- $(top_builddir)/lib/libzpool/libzpool.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzpool/libzpool.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/cmd/zinject/Makefile.am b/cmd/zinject/Makefile.am
index 7c4a5fdbb..091d92cd6 100644
--- a/cmd/zinject/Makefile.am
+++ b/cmd/zinject/Makefile.am
@@ -8,6 +8,6 @@ zinject_SOURCES = \
zinject.h
zinject_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzfs/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/cmd/zpool/Makefile.am b/cmd/zpool/Makefile.am
index cd847a170..c0378b136 100644
--- a/cmd/zpool/Makefile.am
+++ b/cmd/zpool/Makefile.am
@@ -22,10 +22,10 @@ zpool_SOURCES += os/linux/zpool_vdev_os.c
endif
zpool_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(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/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la \
+ $(abs_top_builddir)/lib/libuutil/libuutil.la
zpool_LDADD += $(LTLIBINTL)
diff --git a/cmd/zstream/Makefile.am b/cmd/zstream/Makefile.am
index a3b678d0a..5e0312f23 100644
--- a/cmd/zstream/Makefile.am
+++ b/cmd/zstream/Makefile.am
@@ -9,6 +9,6 @@ zstream_SOURCES = \
zstream_redup.c
zstream_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzfs/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
diff --git a/cmd/ztest/Makefile.am b/cmd/ztest/Makefile.am
index 4790e62ca..40d029d9f 100644
--- a/cmd/ztest/Makefile.am
+++ b/cmd/ztest/Makefile.am
@@ -15,9 +15,9 @@ ztest_SOURCES = \
ztest.c
ztest_LDADD = \
- $(top_builddir)/lib/libzpool/libzpool.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la \
- $(top_builddir)/lib/libnvpair/libnvpair.la
+ $(abs_top_builddir)/lib/libzpool/libzpool.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la \
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la
ztest_LDADD += -lm
ztest_LDFLAGS = -pthread
diff --git a/contrib/pam_zfs_key/Makefile.am b/contrib/pam_zfs_key/Makefile.am
index a67153dda..f0f2550af 100644
--- a/contrib/pam_zfs_key/Makefile.am
+++ b/contrib/pam_zfs_key/Makefile.am
@@ -7,10 +7,10 @@ pammodule_LTLIBRARIES=pam_zfs_key.la
pam_zfs_key_la_SOURCES = pam_zfs_key.c
pam_zfs_key_la_LIBADD = \
- $(top_builddir)/lib/libnvpair/libnvpair.la \
- $(top_builddir)/lib/libuutil/libuutil.la \
- $(top_builddir)/lib/libzfs/libzfs.la \
- $(top_builddir)/lib/libzfs_core/libzfs_core.la
+ $(abs_top_builddir)/lib/libnvpair/libnvpair.la \
+ $(abs_top_builddir)/lib/libuutil/libuutil.la \
+ $(abs_top_builddir)/lib/libzfs/libzfs.la \
+ $(abs_top_builddir)/lib/libzfs_core/libzfs_core.la
pam_zfs_key_la_LDFLAGS = -version-info 1:0:0 -avoid-version -module -shared
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)
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
diff --git a/tests/zfs-tests/tests/functional/checksum/Makefile.am b/tests/zfs-tests/tests/functional/checksum/Makefile.am
index 265a4b16e..3ad48ccd4 100644
--- a/tests/zfs-tests/tests/functional/checksum/Makefile.am
+++ b/tests/zfs-tests/tests/functional/checksum/Makefile.am
@@ -1,8 +1,8 @@
include $(top_srcdir)/config/Rules.am
LDADD = \
- $(top_builddir)/lib/libicp/libicp.la \
- $(top_builddir)/lib/libspl/libspl_assert.la
+ $(abs_top_builddir)/lib/libicp/libicp.la \
+ $(abs_top_builddir)/lib/libspl/libspl_assert.la
pkgdatadir = $(datadir)/@PACKAGE@/zfs-tests/tests/functional/checksum
diff --git a/tests/zfs-tests/tests/functional/hkdf/Makefile.am b/tests/zfs-tests/tests/functional/hkdf/Makefile.am
index be65f8c0e..8ac905322 100644
--- a/tests/zfs-tests/tests/functional/hkdf/Makefile.am
+++ b/tests/zfs-tests/tests/functional/hkdf/Makefile.am
@@ -14,4 +14,4 @@ pkgexec_PROGRAMS = \
hkdf_test_SOURCES = hkdf_test.c
hkdf_test_LDADD = \
- $(top_builddir)/lib/libzpool/libzpool.la
+ $(abs_top_builddir)/lib/libzpool/libzpool.la
diff --git a/tests/zfs-tests/tests/functional/libzfs/Makefile.am b/tests/zfs-tests/tests/functional/libzfs/Makefile.am
index e9a703f49..53cb63544 100644
--- a/tests/zfs-tests/tests/functional/libzfs/Makefile.am
+++ b/tests/zfs-tests/tests/functional/libzfs/Makefile.am
@@ -10,7 +10,7 @@ dist_pkgdata_SCRIPTS = \
libzfs_input.ksh
many_fds_LDADD = \
- $(top_builddir)/lib/libzfs/libzfs.la
+ $(abs_top_builddir)/lib/libzfs/libzfs.la
pkgexec_PROGRAMS = many_fds
many_fds_SOURCES = many_fds.c