Internal xfsprogs libraries are linked statically to binaries as
they are not shipped libraries. Using --disable-static prevents the
internal static libraries from being built and this breaks dead code
elimination and results in linker failures from link dependencies
introduced by dead code.
We can't remove the --disable-static option that causes this as it
is part of the libtool/autoconf generated infrastructure. We can,
however, override --disable-static on a per-library basis inside the
build by passing -static to the libtool link command. Therefore, add
-static to all the internal libraries we build and link statically
to the shipping binaries.
This build command now succeeds:
$ make realclean; make configure; ./configure --disable-static ; make
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
LT_CURRENT = 0
LT_REVISION = 0
LT_AGE = 0
+# we need a static build even if --disable-static is specified
+LTLDFLAGS += -static
CFILES = \
avl64.c \
LT_CURRENT = 0
LT_REVISION = 0
LT_AGE = 0
+# we need a static build even if --disable-static is specified
+LTLDFLAGS += -static
CFILES = command.c input.c help.c quit.c
LT_CURRENT = 0
LT_REVISION = 0
LT_AGE = 0
+# we need a static build even if --disable-static is specified
+LTLDFLAGS += -static
# headers to install in include/xfs
PKGHFILES = xfs_fs.h \
LT_CURRENT = 0
LT_REVISION = 0
LT_AGE = 0
+# we need a static build even if --disable-static is specified
+LTLDFLAGS += -static
CFILES = xfs_log_recover.c util.c