From: Dave Chinner Date: Tue, 7 Apr 2020 18:29:39 +0000 (-0400) Subject: xfsprogs: Fix --disable-static option build X-Git-Tag: v5.6.0-rc1~12 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=825b743251b55e9713f13de2718ca6ffb3358ab4;p=users%2Fhch%2Fxfsprogs.git xfsprogs: Fix --disable-static option build 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 Reviewed-by: Christoph Hellwig Signed-off-by: Eric Sandeen --- diff --git a/libfrog/Makefile b/libfrog/Makefile index 780600cde..395ce3080 100644 --- a/libfrog/Makefile +++ b/libfrog/Makefile @@ -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 \ diff --git a/libxcmd/Makefile b/libxcmd/Makefile index 914bec024..f9bc1c5c4 100644 --- a/libxcmd/Makefile +++ b/libxcmd/Makefile @@ -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 diff --git a/libxfs/Makefile b/libxfs/Makefile index fbcc963a5..8c19836f2 100644 --- a/libxfs/Makefile +++ b/libxfs/Makefile @@ -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 \ diff --git a/libxlog/Makefile b/libxlog/Makefile index bdea6abac..b0f5ef154 100644 --- a/libxlog/Makefile +++ b/libxlog/Makefile @@ -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