aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAntonio Russo <[email protected]>2020-11-14 21:35:31 -0700
committerBrian Behlendorf <[email protected]>2020-11-17 09:18:52 -0800
commit14c34c3d49319a0fea937d54167602c43ff9d93f (patch)
tree7ca38e771ad64cb64fcc1817e01a0029fe4f7639 /lib
parente6c59cd171bf141eae232db2f4c33ff79d5862c3 (diff)
Library ABI tracking with abigail
Provide two make targets: checkabi and storeabi. storeabi uses libabigail to generate a reference copy of the ABI for the public libraries. checkabi compares such a reference to the compiled version, failing if they are not compatible. No ABI is generated for libzpool.so, it is only used by ztest and zdb and not external consumers. Co-authored-by: Brian Behlendorf <[email protected]> Signed-off-by: Antonio Russo <[email protected]> Closes #11144
Diffstat (limited to 'lib')
-rw-r--r--lib/Makefile.am19
-rw-r--r--lib/libnvpair/Makefile.am3
-rw-r--r--lib/libnvpair/libnvpair.suppr2
-rw-r--r--lib/libuutil/Makefile.am3
-rw-r--r--lib/libuutil/libuutil.suppr2
-rw-r--r--lib/libzfs/Makefile.am3
-rw-r--r--lib/libzfs/libzfs.suppr13
-rw-r--r--lib/libzfs_core/Makefile.am3
-rw-r--r--lib/libzfs_core/libzfs_core.suppr5
-rw-r--r--lib/libzfsbootenv/Makefile.am3
-rw-r--r--lib/libzfsbootenv/libzfsbootenv.suppr2
11 files changed, 57 insertions, 1 deletions
diff --git a/lib/Makefile.am b/lib/Makefile.am
index f049288a1..685c7b669 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -15,4 +15,21 @@ SUBDIRS += libzutil libunicode
# These five libraries, which are installed as the final build product,
# incorporate the eight convenience libraries given above.
-SUBDIRS += libuutil libzfs_core libzfs libzpool libzfsbootenv
+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
+checkabi: $(ABILIBS)
+ set -e ; for dir in $(ABILIBS) ; do \
+ $(MAKE) -C $$dir checkabi ; \
+ done
+
+storeabi: $(ABILIBS)
+ set -e ; for dir in $(ABILIBS) ; do \
+ $(MAKE) -C $$dir storeabi ; \
+ done
diff --git a/lib/libnvpair/Makefile.am b/lib/libnvpair/Makefile.am
index f23ac3cdf..8d5a62980 100644
--- a/lib/libnvpair/Makefile.am
+++ b/lib/libnvpair/Makefile.am
@@ -1,4 +1,5 @@
include $(top_srcdir)/config/Rules.am
+PHONY =
VPATH = \
$(top_srcdir)/module/nvpair \
@@ -10,6 +11,8 @@ AM_CFLAGS += $(FRAME_LARGER_THAN) $(LIBTIRPC_CFLAGS)
lib_LTLIBRARIES = libnvpair.la
+include $(top_srcdir)/config/Abigail.am
+
USER_C = \
libnvpair.c \
libnvpair_json.c \
diff --git a/lib/libnvpair/libnvpair.suppr b/lib/libnvpair/libnvpair.suppr
new file mode 100644
index 000000000..f4db8a49e
--- /dev/null
+++ b/lib/libnvpair/libnvpair.suppr
@@ -0,0 +1,2 @@
+[suppress_type]
+ name = FILE*
diff --git a/lib/libuutil/Makefile.am b/lib/libuutil/Makefile.am
index 4bce1609f..6f1fb4433 100644
--- a/lib/libuutil/Makefile.am
+++ b/lib/libuutil/Makefile.am
@@ -1,7 +1,10 @@
include $(top_srcdir)/config/Rules.am
+PHONY =
lib_LTLIBRARIES = libuutil.la
+include $(top_srcdir)/config/Abigail.am
+
USER_C = \
uu_alloc.c \
uu_avl.c \
diff --git a/lib/libuutil/libuutil.suppr b/lib/libuutil/libuutil.suppr
new file mode 100644
index 000000000..f4db8a49e
--- /dev/null
+++ b/lib/libuutil/libuutil.suppr
@@ -0,0 +1,2 @@
+[suppress_type]
+ name = FILE*
diff --git a/lib/libzfs/Makefile.am b/lib/libzfs/Makefile.am
index bfa5b2a1f..0b0d7b075 100644
--- a/lib/libzfs/Makefile.am
+++ b/lib/libzfs/Makefile.am
@@ -1,4 +1,5 @@
include $(top_srcdir)/config/Rules.am
+PHONY =
VPATH = \
$(top_srcdir)/module/icp \
@@ -13,6 +14,8 @@ pkgconfig_DATA = libzfs.pc
lib_LTLIBRARIES = libzfs.la
+include $(top_srcdir)/config/Abigail.am
+
USER_C = \
libzfs_changelist.c \
libzfs_config.c \
diff --git a/lib/libzfs/libzfs.suppr b/lib/libzfs/libzfs.suppr
new file mode 100644
index 000000000..d55b5b728
--- /dev/null
+++ b/lib/libzfs/libzfs.suppr
@@ -0,0 +1,13 @@
+[suppress_type]
+ name = FILE*
+
+[suppress_type]
+ type_kind = typedef
+ name = SHA256_CTX
+
+[suppress_type]
+ type_kind = typedef
+ name = SHA2_CTX
+
+[suppress_variable]
+ name = zfs_deleg_perm_tab
diff --git a/lib/libzfs_core/Makefile.am b/lib/libzfs_core/Makefile.am
index fb44f1b19..5f1564399 100644
--- a/lib/libzfs_core/Makefile.am
+++ b/lib/libzfs_core/Makefile.am
@@ -1,9 +1,12 @@
include $(top_srcdir)/config/Rules.am
+PHONY =
pkgconfig_DATA = libzfs_core.pc
lib_LTLIBRARIES = libzfs_core.la
+include $(top_srcdir)/config/Abigail.am
+
USER_C = \
libzfs_core.c
diff --git a/lib/libzfs_core/libzfs_core.suppr b/lib/libzfs_core/libzfs_core.suppr
new file mode 100644
index 000000000..109d331cf
--- /dev/null
+++ b/lib/libzfs_core/libzfs_core.suppr
@@ -0,0 +1,5 @@
+[suppress_type]
+ name = FILE*
+
+[suppress_type]
+ name = pthread_cond_t
diff --git a/lib/libzfsbootenv/Makefile.am b/lib/libzfsbootenv/Makefile.am
index 6b9a8f013..354be3efa 100644
--- a/lib/libzfsbootenv/Makefile.am
+++ b/lib/libzfsbootenv/Makefile.am
@@ -1,9 +1,12 @@
include $(top_srcdir)/config/Rules.am
+PHONY =
pkgconfig_DATA = libzfsbootenv.pc
lib_LTLIBRARIES = libzfsbootenv.la
+include $(top_srcdir)/config/Abigail.am
+
if BUILD_FREEBSD
DEFAULT_INCLUDES += -I$(top_srcdir)/include/os/freebsd/zfs
endif
diff --git a/lib/libzfsbootenv/libzfsbootenv.suppr b/lib/libzfsbootenv/libzfsbootenv.suppr
new file mode 100644
index 000000000..f4db8a49e
--- /dev/null
+++ b/lib/libzfsbootenv/libzfsbootenv.suppr
@@ -0,0 +1,2 @@
+[suppress_type]
+ name = FILE*