public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] xfsprogs: "Fix" --disable-static option
@ 2019-08-13  5:14 Dave Chinner
  2019-08-13  5:14 ` [PATCH 1/2] mkfs: use cvtnum from libfrog Dave Chinner
  2019-08-13  5:14 ` [PATCH 2/2] xfsprogs: Fix --disable-static option build Dave Chinner
  0 siblings, 2 replies; 8+ messages in thread
From: Dave Chinner @ 2019-08-13  5:14 UTC (permalink / raw)
  To: linux-xfs

Hi folks,

These patches fix the build failures that come from trying
to prevent static xfsprogs libraries being built via the 
'configure --disable-static' option.

The internal libraries are statically linked to the xfsprogs
binaries, with external dependencies then dynamically linked. Not
building the internal libraries statically results in linking them
dynamically and so the pull in all their dependencies as well. for
example, libfrog has the blkid topology code in it, so when linked
as a shared library it always brings that dependency with it,
regardless of whether the binary actually uses the topology code
or not.

Linking the libraries statically allows dead code elimination to
remove the topology code if it is not used by the binary, hence
eliminating the need to link that binary against libblkid. This
makes the binaries smaller, they load faster, and we don't have to
ship public libraries for all the internal xfsprogs code.

Hence we need to force the internal libraries to build a staticly
linked archive even when a user says "--disable-static". We can do
this by passing libtool the "-static" option on the link link for
each of the internal libraries. Hence we always build static
libraries for the internel libs as the build needs them to be
static.

Doing this, however, exposes the fact taht mkfs has it's own version
of cvtnum and it links against libfrog which also has version of
cvtnum. The linker previously resolved this automatically by using
the local version, but with -static defined it errors out on
multiply-defined symbol errors. SO the first patch fixes the cvtnum
issue. Note i left xfs_estimate alone - it doesn't link against
libfrog, so I didn't remove it's simple cvtnum copy as it's not
necessary to fix the build issue and linking against libfrog might
introduce other issues.

Cheers,

Dave.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-08-14 15:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-08-13  5:14 [PATCH 0/2] xfsprogs: "Fix" --disable-static option Dave Chinner
2019-08-13  5:14 ` [PATCH 1/2] mkfs: use cvtnum from libfrog Dave Chinner
2019-08-13 14:24   ` Darrick J. Wong
2019-08-13 21:29     ` Dave Chinner
2019-08-14 15:18       ` Darrick J. Wong
2019-08-13  5:14 ` [PATCH 2/2] xfsprogs: Fix --disable-static option build Dave Chinner
2019-08-13 14:28   ` Darrick J. Wong
2019-08-13 21:33     ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox