HomeFreeBSD

Use abs_top_builddir when referencing libraries

Description

Use abs_top_builddir when referencing libraries

libtool stores absolute paths in the dependency_libs component of the
.la files. If the Makefile for a dependent library refers to the
libraries by relative path, some libraries end up duplicated on the link
command line.

As an example, libzfs specifies libzfs_core, libnvpair and libuutil as
dependencies to be linked in. The .la file for libzfs_core also
specifies libnvpair, but using an absolute path, with the result that
libnvpair is present twice in the linker command line for producing
libzfs.

While the only thing this causes is to slightly slow down the linking,
we can avoid it by using absolute paths everywhere, including for
convenience libraries just for consistency.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Arvind Sankar <nivedita@alum.mit.edu>
Closes #10538

Details

Provenance
Arvind Sankar <nivedita@alum.mit.edu>Authored on Jul 6 2020, 8:01 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Jul 10 2020, 9:26 PM
Parents
rGaf6591622696: Add -z defs to LDFLAGS
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG3e597dee1128: Use abs_top_builddir when referencing libraries (authored by Arvind Sankar <nivedita@alum.mit.edu>).Jul 10 2020, 9:26 PM