]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: Fix --disable-static option build
authorDave Chinner <dchinner@redhat.com>
Tue, 7 Apr 2020 18:29:39 +0000 (14:29 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Tue, 7 Apr 2020 18:29:39 +0000 (14:29 -0400)
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>
libfrog/Makefile
libxcmd/Makefile
libxfs/Makefile
libxlog/Makefile

index 780600cded25590a034c61fc0fc3ca97981ee307..395ce30804b700cd424049ac2c947d730364c709 100644 (file)
@@ -9,6 +9,8 @@ LTLIBRARY = libfrog.la
 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 \
index 914bec024c46e6bcdf30447ce0390b11c37d09c4..f9bc1c5c483aa6a0cf0c881b8320804afe51d031 100644 (file)
@@ -9,6 +9,8 @@ LTLIBRARY = libxcmd.la
 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
 
index fbcc963a5669cf3be80dd4a2900308ef86bda93d..8c19836f20522a08b74f00076361aacb2c52b5c3 100644 (file)
@@ -9,6 +9,8 @@ LTLIBRARY = libxfs.la
 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 \
index bdea6abacea480f9ef13e147f1c52cc9a773f3cc..b0f5ef15413308556263ba15bd99af7a590bc982 100644 (file)
@@ -9,6 +9,8 @@ LTLIBRARY = libxlog.la
 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