diff mbox series

[3/3] tools/libs: Check ABI # DO NOT APPLY YET

Message ID 20210301170044.23295-4-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series tools: ABI checking | expand

Commit Message

Andrew Cooper March 1, 2021, 5 p.m. UTC
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Ian Jackson <iwj@xenproject.org>
CC: Wei Liu <wl@xen.org>
CC: Juergen Gross <jgross@suse.com>
---
 tools/libs/.gitignore |  2 ++
 tools/libs/libs.mk    | 15 +++++++++++----
 2 files changed, 13 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/tools/libs/.gitignore b/tools/libs/.gitignore
index 4a13126144..655f46a6e8 100644
--- a/tools/libs/.gitignore
+++ b/tools/libs/.gitignore
@@ -1 +1,3 @@ 
+*/abi.chk
+*/compat_reports/
 */headers.lst
diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index a68cec244c..c12e779e63 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -96,12 +96,19 @@  lib$(LIB_FILE_NAME).so.$(MAJOR): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR)
 lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR): $(PIC_OBJS) libxen$(LIBNAME).map
 	$(CC) $(LDFLAGS) $(PTHREAD_LDFLAGS) -Wl,$(SONAME_LDFLAG) -Wl,lib$(LIB_FILE_NAME).so.$(MAJOR) $(SHLIB_LDFLAGS) -o $@ $(PIC_OBJS) $(LDUSELIBS) $(APPEND_LDFLAGS)
 
-# If abi-dumper is available, write out the ABI analysis
-ifneq ($(ABI_DUMPER),)
-libs: $(PKG_ABI)
 $(PKG_ABI): lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) headers.lst
 	$(ABI_DUMPER) $< -o $@ -public-headers headers.lst -lver $(MAJOR).$(MINOR)
+
+abi.chk: $(PKG_OLD_ABI) $(PKG_ABI)
+	$(ABI_COMPLIANCE_CHECKER) -l lib$(LIB_FILE_NAME) -old $(PKG_OLD_ABI) -new $(PKG_ABI)
+	touch $@
+
+ifneq ($(ABI_COMPLIANCE_CHECKER),)
+ifeq ($(debug_symbols),y)
+libs: abi.chk
 endif
+endif
+
 
 .PHONY: install
 install: build
@@ -131,7 +138,7 @@  TAGS:
 clean:
 	rm -rf *.rpm $(LIB) *~ $(DEPS_RM) $(LIB_OBJS) $(PIC_OBJS)
 	rm -f lib$(LIB_FILE_NAME).so.$(MAJOR).$(MINOR) lib$(LIB_FILE_NAME).so.$(MAJOR)
-	rm -f headers.chk headers.lst
+	rm -f headers.chk headers.lst abi.chk
 	rm -f $(PKG_CONFIG)
 	rm -f _paths.h