public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED] libsframe: add library versioning
Date: Tue, 27 Jun 2023 12:51:15 -0700	[thread overview]
Message-ID: <20230627195126.1955051-1-indu.bhagat@oracle.com> (raw)

lisbframe was first released with Bintuils 2.40.  As the library
evolves, some changes will break the ABI.  Add library versioning for
users to manage these changes.

For the next release of the library (libsframe.so.1), incompatible ABI
changes are planned. These will include:
 - Deprecation of some APIs, like sframe_get_funcdesc_with_addr (), and
 - Change in the contract of some APIs (e.g., return type, behavior).

In libtool-version, set the current to 1 to prepare for the upcoming
release.  Reset revision and age to 0.

Add libtool-version file to EXTRA_DIST.

libsframe/
	* Makefile.am: Use libtool versioning.
	* Makefile.in: Regenerated.
	* libtool-version: New file.
---
 libsframe/Makefile.am     |  5 +++++
 libsframe/Makefile.in     |  9 ++++++++-
 libsframe/libtool-version | 30 ++++++++++++++++++++++++++++++
 3 files changed, 43 insertions(+), 1 deletion(-)
 create mode 100644 libsframe/libtool-version

diff --git a/libsframe/Makefile.am b/libsframe/Makefile.am
index 2d736624208..2d1d8fff063 100644
--- a/libsframe/Makefile.am
+++ b/libsframe/Makefile.am
@@ -29,6 +29,7 @@ INCDIR = $(srcdir)/../include
 # include libctf for swap.h
 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../libctf
 AM_CFLAGS = @ac_libsframe_warn_cflags@
+libsframe_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 
 if INSTALL_LIBBFD
 lib_LTLIBRARIES = libsframe.la
@@ -40,6 +41,10 @@ endif
 
 libsframe_la_SOURCES = sframe.c sframe-dump.c sframe-error.c
 libsframe_la_CPPFLAGS = $(AM_CPPFLAGS)
+libsframe_la_LDFLAGS = $(libsframe_version_info)
+
+EXTRA_DIST = libtool-version
+diststuff: $(EXTRA_DIST) info
 
 include doc/local.mk
 
diff --git a/libsframe/Makefile.in b/libsframe/Makefile.in
index c6a4cd56a9e..57f912caa13 100644
--- a/libsframe/Makefile.in
+++ b/libsframe/Makefile.in
@@ -180,6 +180,9 @@ AM_V_lt = $(am__v_lt_@AM_V@)
 am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
 am__v_lt_0 = --silent
 am__v_lt_1 = 
+libsframe_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(libsframe_la_LDFLAGS) $(LDFLAGS) -o $@
 @INSTALL_LIBBFD_FALSE@am_libsframe_la_rpath =
 @INSTALL_LIBBFD_TRUE@am_libsframe_la_rpath = -rpath $(libdir)
 @HAVE_COMPAT_DEJAGNU_TRUE@am__EXEEXT_1 = testsuite/libsframe.decode/be-flipping$(EXEEXT) \
@@ -519,12 +522,15 @@ INCDIR = $(srcdir)/../include
 # include libctf for swap.h
 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../include -I$(srcdir)/../libctf
 AM_CFLAGS = @ac_libsframe_warn_cflags@
+libsframe_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
 @INSTALL_LIBBFD_TRUE@lib_LTLIBRARIES = libsframe.la
 @INSTALL_LIBBFD_FALSE@include_HEADERS = 
 @INSTALL_LIBBFD_TRUE@include_HEADERS = $(INCDIR)/sframe.h $(INCDIR)/sframe-api.h
 @INSTALL_LIBBFD_FALSE@noinst_LTLIBRARIES = libsframe.la
 libsframe_la_SOURCES = sframe.c sframe-dump.c sframe-error.c
 libsframe_la_CPPFLAGS = $(AM_CPPFLAGS)
+libsframe_la_LDFLAGS = $(libsframe_version_info)
+EXTRA_DIST = libtool-version
 @BUILD_INFO_TRUE@AM_MAKEINFOFLAGS = --no-split
 
 # Setup the testing framework
@@ -654,7 +660,7 @@ clean-noinstLTLIBRARIES:
 	}
 
 libsframe.la: $(libsframe_la_OBJECTS) $(libsframe_la_DEPENDENCIES) $(EXTRA_libsframe_la_DEPENDENCIES) 
-	$(AM_V_CCLD)$(LINK) $(am_libsframe_la_rpath) $(libsframe_la_OBJECTS) $(libsframe_la_LIBADD) $(LIBS)
+	$(AM_V_CCLD)$(libsframe_la_LINK) $(am_libsframe_la_rpath) $(libsframe_la_OBJECTS) $(libsframe_la_LIBADD) $(LIBS)
 
 clean-checkPROGRAMS:
 	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
@@ -1568,6 +1574,7 @@ uninstall-am: uninstall-dvi-am uninstall-html-am \
 
 .PRECIOUS: Makefile
 
+diststuff: $(EXTRA_DIST) info
 
 @BUILD_INFO_TRUE@html-local: doc/sframe-spec/index.html
 @BUILD_INFO_TRUE@doc/sframe-spec/index.html: doc/sframe-spec.texi doc/$(am__dirstamp)
diff --git a/libsframe/libtool-version b/libsframe/libtool-version
new file mode 100644
index 00000000000..9dcbe48e47d
--- /dev/null
+++ b/libsframe/libtool-version
@@ -0,0 +1,30 @@
+# This file is used to maintain libtool version info for libsframe.  See
+# the libtool manual to understand the meaning of the fields.  This is
+# a separate file so that version updates don't involve re-running
+# automake.
+#
+# Here are a set of rules to help you update your library version
+# information:
+#
+# 1. Start with version information of `0:0:0' for each libtool library.
+#
+# 2. Update the version information only immediately before a public
+#    release of your software. More frequent updates are unnecessary,
+#    and only guarantee that the current interface number gets larger
+#    faster.
+#
+# 3. If the library source code has changed at all since the last
+#    update, then increment revision (`c:r:a' becomes `c:r+1:a').
+#
+# 4. If any interfaces have been added, removed, or changed since the
+#    last update, increment current, and set revision to 0.
+#
+# 5. Increase the age value only if the changes made to the ABI are backward
+#    compatible.
+#    a. If any interfaces have been added since the last public release,
+#       then increment age.
+#    b. If any interfaces have been removed since the last public release,
+#       then set age to 0.
+#
+# CURRENT:REVISION:AGE
+1:0:0
-- 
2.39.2


             reply	other threads:[~2023-06-27 19:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-27 19:51 Indu Bhagat [this message]
2023-06-27 19:51 ` [COMMITTED] libsframe: remove sframe_get_funcdesc_with_addr API Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: add symbol versioning Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: update the semantics of sframe_fre_get_ra_offset Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: update the semantics of sframe_fre_get_fp_offset Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: use uint32_t for fre_type and fde_type function args Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: bfd: use uint32_t for return type of sframe_calc_fre_type Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: use uint8_t instead of unsigned char for abi_arch Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: use uint8_t for return type of sframe_fre_get_base_reg_id Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: use appropriate data types for args of sframe_encode Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] libsframe: bfd: use uint32_t for return type of get_num_fidx APIs Indu Bhagat
2023-06-27 19:51 ` [COMMITTED] binutils/NEWS: add note about upcoming libsframe changes Indu Bhagat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230627195126.1955051-1-indu.bhagat@oracle.com \
    --to=indu.bhagat@oracle.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).