Fixed LDADD library links in Makefiles for cross compilation builds

When building on native dev system, there are no issues but when
cross-compiling for target system, some linker errors are observed.
The only way to avoid these errors is by adjusting the Makefile.am
of those various components to add the library dependencies.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Petros Koutoupis <petros@petroskoutoupis.com>
Closes #10304
This commit is contained in:
Petros Koutoupis 2020-05-09 12:17:08 -05:00 committed by GitHub
parent d775c86dd4
commit bd95f00d4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 12 additions and 1 deletions

View File

@ -14,4 +14,5 @@ mount_zfs_SOURCES = \
mount_zfs_LDADD = \ mount_zfs_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la

View File

@ -14,6 +14,7 @@ raidz_test_SOURCES = \
raidz_bench.c raidz_bench.c
raidz_test_LDADD = \ raidz_test_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la $(top_builddir)/lib/libzpool/libzpool.la
raidz_test_LDADD += -lm -ldl raidz_test_LDADD += -lm -ldl

View File

@ -38,6 +38,7 @@ zed_SOURCES = $(ZED_SRC) $(FMA_SRC)
zed_LDADD = \ zed_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la
zed_LDADD += -lrt zed_LDADD += -lrt

View File

@ -9,4 +9,5 @@ zinject_SOURCES = \
zinject_LDADD = \ zinject_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la

View File

@ -22,6 +22,7 @@ endif
zpool_LDADD = \ zpool_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libuutil/libuutil.la \ $(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la
if BUILD_FREEBSD if BUILD_FREEBSD

View File

@ -10,4 +10,5 @@ zstream_SOURCES = \
zstream_LDADD = \ zstream_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \ $(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la

View File

@ -29,4 +29,5 @@ btree_test_SOURCES = btree_test.c
btree_test_LDADD = \ btree_test_LDADD = \
$(top_builddir)/lib/libavl/libavl.la \ $(top_builddir)/lib/libavl/libavl.la \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la $(top_builddir)/lib/libzpool/libzpool.la

View File

@ -1,6 +1,8 @@
include $(top_srcdir)/config/Rules.am include $(top_srcdir)/config/Rules.am
LDADD = $(top_builddir)/lib/libzpool/libzpool.la LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la
AUTOMAKE_OPTIONS = subdir-objects AUTOMAKE_OPTIONS = subdir-objects

View File

@ -10,6 +10,8 @@ dist_pkgdata_SCRIPTS = \
libzfs_input.ksh libzfs_input.ksh
many_fds_LDADD = \ many_fds_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la $(top_builddir)/lib/libzfs/libzfs.la
pkgexec_PROGRAMS = many_fds pkgexec_PROGRAMS = many_fds