From 716895b161e31e4db559566fa1dddc3d8d8c64c0 Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 18 Mar 2011 14:47:19 -0700 Subject: [PATCH] Fix 'LDFLAGS=-Wl,--as-needed' build error Compiling with 'LDFLAGS=-Wl,--as-needed' exposed the fact that there were some library linking problems introduced by mount_zfs. In particular, the libzfs library does use nvpair symbols, and mount_zfs contains no dependencies on libzpool. Closes #161 Closes #162 --- cmd/mount_zfs/Makefile.am | 1 - cmd/mount_zfs/Makefile.in | 2 -- lib/libzfs/Makefile.am | 1 + lib/libzfs/Makefile.in | 2 ++ 4 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmd/mount_zfs/Makefile.am b/cmd/mount_zfs/Makefile.am index f5d2db0ba..3d6b423a6 100644 --- a/cmd/mount_zfs/Makefile.am +++ b/cmd/mount_zfs/Makefile.am @@ -21,7 +21,6 @@ mount_zfs_LDADD = \ $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libunicode/libunicode.la \ $(top_builddir)/lib/libuutil/libuutil.la \ - $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la mount_zfs_LDFLAGS = \ diff --git a/cmd/mount_zfs/Makefile.in b/cmd/mount_zfs/Makefile.in index 18d3c6e22..776777de8 100644 --- a/cmd/mount_zfs/Makefile.in +++ b/cmd/mount_zfs/Makefile.in @@ -91,7 +91,6 @@ mount_zfs_DEPENDENCIES = $(top_builddir)/lib/libspl/libspl.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libunicode/libunicode.la \ $(top_builddir)/lib/libuutil/libuutil.la \ - $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la AM_V_lt = $(am__v_lt_$(V)) am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) @@ -316,7 +315,6 @@ mount_zfs_LDADD = \ $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libunicode/libunicode.la \ $(top_builddir)/lib/libuutil/libuutil.la \ - $(top_builddir)/lib/libzpool/libzpool.la \ $(top_builddir)/lib/libzfs/libzfs.la mount_zfs_LDFLAGS = \ diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am index e11d8b30f..f239e7b4b 100644 --- a/lib/libzfs/Makefile.am +++ b/lib/libzfs/Makefile.am @@ -11,6 +11,7 @@ libzfs_la_LDFLAGS = -lm -ldl $(LIBSELINUX) libzfs_la_LIBADD = \ $(top_builddir)/lib/libspl/libspl.la \ $(top_builddir)/lib/libefi/libefi.la \ + $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libzpool/libzpool.la diff --git a/lib/libzfs/Makefile.in b/lib/libzfs/Makefile.in index 3bab38888..f2682a2d0 100644 --- a/lib/libzfs/Makefile.in +++ b/lib/libzfs/Makefile.in @@ -105,6 +105,7 @@ am__installdirs = "$(DESTDIR)$(libdir)" LTLIBRARIES = $(lib_LTLIBRARIES) libzfs_la_DEPENDENCIES = $(top_builddir)/lib/libspl/libspl.la \ $(top_builddir)/lib/libefi/libefi.la \ + $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libzpool/libzpool.la am_libzfs_la_OBJECTS = libzfs_changelist.lo libzfs_config.lo \ @@ -325,6 +326,7 @@ libzfs_la_LDFLAGS = -lm -ldl $(LIBSELINUX) libzfs_la_LIBADD = \ $(top_builddir)/lib/libspl/libspl.la \ $(top_builddir)/lib/libefi/libefi.la \ + $(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libzpool/libzpool.la