[PATCH 0/2] xfsprogs: "Fix" --disable-static option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux