Skip to content

Commit

Permalink
Fixed LDADD library links in Makefiles for cross compilation builds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pkoutoupis authored May 9, 2020
1 parent d775c86 commit bd95f00
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmd/mount_zfs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ mount_zfs_SOURCES = \

mount_zfs_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la
1 change: 1 addition & 0 deletions cmd/raidz_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ raidz_test_SOURCES = \
raidz_bench.c

raidz_test_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la

raidz_test_LDADD += -lm -ldl
1 change: 1 addition & 0 deletions cmd/zed/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ zed_SOURCES = $(ZED_SRC) $(FMA_SRC)
zed_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la

zed_LDADD += -lrt
Expand Down
1 change: 1 addition & 0 deletions cmd/zinject/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ zinject_SOURCES = \

zinject_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la
1 change: 1 addition & 0 deletions cmd/zpool/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ endif
zpool_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libuutil/libuutil.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la

if BUILD_FREEBSD
Expand Down
1 change: 1 addition & 0 deletions cmd/zstream/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ zstream_SOURCES = \

zstream_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la
1 change: 1 addition & 0 deletions tests/zfs-tests/cmd/btree_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ btree_test_SOURCES = btree_test.c

btree_test_LDADD = \
$(top_builddir)/lib/libavl/libavl.la \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzpool/libzpool.la
4 changes: 3 additions & 1 deletion tests/zfs-tests/tests/functional/hkdf/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
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

Expand Down
2 changes: 2 additions & 0 deletions tests/zfs-tests/tests/functional/libzfs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ dist_pkgdata_SCRIPTS = \
libzfs_input.ksh

many_fds_LDADD = \
$(top_builddir)/lib/libnvpair/libnvpair.la \
$(top_builddir)/lib/libzfs_core/libzfs_core.la \
$(top_builddir)/lib/libzfs/libzfs.la

pkgexec_PROGRAMS = many_fds
Expand Down

0 comments on commit bd95f00

Please sign in to comment.