aboutsummaryrefslogtreecommitdiff
path: root/sys/contrib/openzfs/lib/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/openzfs/lib/Makefile.am')
-rw-r--r--sys/contrib/openzfs/lib/Makefile.am110
1 files changed, 76 insertions, 34 deletions
diff --git a/sys/contrib/openzfs/lib/Makefile.am b/sys/contrib/openzfs/lib/Makefile.am
index f07975cc03fc..050a6cac0a37 100644
--- a/sys/contrib/openzfs/lib/Makefile.am
+++ b/sys/contrib/openzfs/lib/Makefile.am
@@ -9,11 +9,11 @@
# These library interfaces are subject to change at any time.
#
#
-# CMDS: zhack/ztest/zdb/ zfs/zpool/zed/
+# CMDS: zhack/ztest/ zfs/zpool/zed/
# raidz_{test,bench} zinject/zstream
# | |
# LIBS: | | libzfsbootenv*
-# | | |
+# |--libzdb--zdb | |
# | | |
# libzpool libzfs* ----------------+
# | | | \ / | | |
@@ -33,50 +33,92 @@
# | | |
# \-------- libspl ----+------/
#
-# * - A stable ABI is provided for these libraries
-#
#
# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
# These nine libraries are intermediary build components.
#
-SUBDIRS = libavl libicp libshare libspl libtpool libzstd
-CPPCHECKDIRS = libavl libicp libnvpair libshare libspl libtpool libunicode
-CPPCHECKDIRS += libuutil libzfs libzfs_core libzfsbootenv libzpool libzutil
+# * - A stable ABI is provided for these libraries;
+# when performing an ABI check the following options are applied:
+#
+# --no-unreferenced-symbols: Exclude symbols which are not referenced by
+# any debug information. Without this _init() and _fini() are incorrectly
+# reported on CentOS7 for libuutil.so.
+#
+# --headers-dir1: Limit ABI checks to public OpenZFS headers, otherwise
+# changes in public system headers are also reported.
+#
+# --suppressions: Honor a suppressions file for each library to provide
+# a mechanism for suppressing harmless warnings.
+#
+noinst_LTLIBRARIES =
+lib_LTLIBRARIES =
+pkgconfig_DATA =
+include $(srcdir)/%D%/libavl/Makefile.am
+include $(srcdir)/%D%/libicp/Makefile.am
+include $(srcdir)/%D%/libnvpair/Makefile.am
+include $(srcdir)/%D%/libshare/Makefile.am
+include $(srcdir)/%D%/libspl/Makefile.am
+include $(srcdir)/%D%/libtpool/Makefile.am
+include $(srcdir)/%D%/libunicode/Makefile.am
+include $(srcdir)/%D%/libuutil/Makefile.am
+include $(srcdir)/%D%/libzdb/Makefile.am
+include $(srcdir)/%D%/libzfs_core/Makefile.am
+include $(srcdir)/%D%/libzfs/Makefile.am
+include $(srcdir)/%D%/libzfsbootenv/Makefile.am
+include $(srcdir)/%D%/libzpool/Makefile.am
+include $(srcdir)/%D%/libzstd/Makefile.am
+include $(srcdir)/%D%/libzutil/Makefile.am
if BUILD_LINUX
-SUBDIRS += libefi
-CPPCHECKDIRS += libefi
+include $(srcdir)/%D%/libefi/Makefile.am
endif
-# libnvpair is installed as part of the final build product
-# libzutil depends on it, so it must be compiled before libzutil
-SUBDIRS += libnvpair
-# libzutil depends on libefi if present
-SUBDIRS += libzutil libunicode
+PHONY += lib
+lib: $(noinst_LTLIBRARIES) $(lib_LTLIBRARIES)
-# These five libraries, which are installed as the final build product,
-# incorporate the eight convenience libraries given above.
-DISTLIBS = libuutil libzfs_core libzfs libzpool libzfsbootenv
-SUBDIRS += $(DISTLIBS)
-DISTLIBS += libnvpair
-# An ABI is stored for each of these libraries. Note that libzpool.so
-# is only linked against by ztest and zdb and no stable ABI is provided.
-ABILIBS = libnvpair libuutil libzfs_core libzfs libzfsbootenv
+PHONY += checkabi storeabi check_libabi_version allow_libabi_only_for_x86_64
-PHONY = checkabi storeabi cppcheck
-checkabi: $(ABILIBS)
- set -e ; for dir in $(ABILIBS) ; do \
- $(MAKE) -C $$dir checkabi ; \
- done
+check_libabi_version:
+ if [ $$(abidw -v | $(SED) 's/[^0-9]//g') -lt 200 ]; then \
+ printf '%s\n' "" \
+ "*** Please use libabigail 2.0.0 version or newer;" \
+ "*** otherwise results are not consistent!" \
+ "(or see https://github.com/openzfs/libabigail-docker)"; \
+ exit 1; \
+ fi
-storeabi: $(ABILIBS)
- set -e ; for dir in $(ABILIBS) ; do \
- $(MAKE) -C $$dir storeabi ; \
- done
+allow_libabi_only_for_x86_64:
+ echo '*** ABI definitions provided apply only to x86_64:'
+ echo '*** not checking or storing ABI and assuming success.'
-cppcheck: $(CPPCHECKDIRS)
- set -e ; for dir in $(CPPCHECKDIRS) ; do \
- $(MAKE) -C $$dir cppcheck ; \
+if TARGET_CPU_X86_64
+# These should depend on $(lib_LTLIBRARIES), but this breaks on CI when bound into Docker
+checkabi: check_libabi_version
+ err=0; \
+ for lib in $(lib_LTLIBRARIES); do \
+ lib=$${lib%.la}; \
+ [ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
+ echo $$lib:; \
+ abidiff --no-unreferenced-symbols \
+ --headers-dir1 include \
+ --suppressions $(srcdir)/lib/$$lib/$$lib.suppr \
+ $(srcdir)/lib/$$lib/$$lib.abi .libs/$$lib.so || err=$$((err + 1)); \
+ done; \
+ exit $$err
+
+storeabi: check_libabi_version
+ for lib in $(lib_LTLIBRARIES); do \
+ lib=$${lib%.la}; \
+ [ -f $(srcdir)/lib/$$lib/$$lib.suppr ] || continue; \
+ abidw --no-show-locs \
+ --no-corpus-path \
+ --no-comp-dir-path \
+ --type-id-style hash \
+ .libs/$$lib.so > $(srcdir)/lib/$$lib/$$lib.abi; \
done
+else
+checkabi: allow_libabi_only_for_x86_64
+storeabi: allow_libabi_only_for_x86_64
+endif