public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@seketeli.org>
To: Ben Woodard via Libabigail <libabigail@sourceware.org>
Cc: Ben Woodard <woodard@redhat.com>
Subject: Re: [PATCH] Bug 28669 Increment Library version
Date: Tue, 06 Sep 2022 17:41:23 +0200	[thread overview]
Message-ID: <87a67cik7w.fsf@seketeli.org> (raw)
In-Reply-To: <20220628222600.1362127-1-woodard@redhat.com> (Ben Woodard via Libabigail's message of "Tue, 28 Jun 2022 15:26:00 -0700")

Hello,

Ben Woodard via Libabigail <libabigail@sourceware.org> a écrit:

> Add library version to libabigail 2.1 to not cause problems with older
> utilities due to library version incompatibility. This will also stop
> tools that look for libraries which have a different ABI but the same
> version from complaining.
>
> 	* src/Makefile.am: Add library version.

This is nice and long overdue, so Thank You for getting your hands dirty on
this task.

I have slightly augmented the change to define the CURRENT,REVISION and
AGE libtool variables in the configure.ac file so that we can update
them there at release time, just like what we do for the major and minor
version numbers of the project as well as the ABIXML version numbers.
The -version option passed to the linker then re-uses the libtool
variables defined in configure.ac.

Below is the resulting patch that I am applying to master to that
effect.

Cheers,
 
From 2bfea52331211cf16fba00d4d2a40f9bbc679cf8 Mon Sep 17 00:00:00 2001
From: Ben Woodard via Libabigail <libabigail@sourceware.org>
Date: Tue, 28 Jun 2022 15:26:00 -0700
Subject: [PATCH] Bug 28669 - Increment Library version

Add libtool versioning to libabigail.so starting from 2.1 onward to
not cause problems with older utilities due to library version
incompatibility. This will also stop tools that look for libraries
which have a different ABI but the same version from complaining.

	* configure.ac: Define the variables libabigail_so_{current,
	revision, age}.  These are to be adjusted after each releases
	depending on how the compatibility status of the libabigail's
	code.
	* src/Makefile.am: Add -version-info
	$(LIBABIGAIL_SO_CURRENT):$(LIBABIGAIL_SO_REVISION):$(LIBABIGAIL_SO_AGE)
	to LDFLAGS.

Signed-off-by: Ben Woodard <woodard@redhat.com>
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 configure.ac    | 33 +++++++++++++++++++++++++++++++++
 src/Makefile.am |  2 +-
 2 files changed, 34 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 97b3469f..ee8885e9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,34 @@
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+dnl Libabigail version number is handled here with the major and minor
+dnl version numbers.
 m4_define([version_major],   [2])
 m4_define([version_minor],   [1])
 
+dnl Below are the numbers to handle libabigail.so's versionning
+dnl following the libtool's versionning scheme to handle shared
+dnl libraries' compatibility.
+dnl
+dnl Below are the rules to follow to update the three numbers
+dnl (LIBABIGAIL_SO_CURRENT, LIBABIGAIL_SO_REVISION and LIBABIGAIL_SO_AGE):
+dnl
+dnl 1. If the library source code has changed at all since the last
+dnl    update, then increment LIBABIGAIL_SO_REVISION ('C:R:A' becomes
+dnl    'C:R+1:A').
+dnl 
+dnl 2. If any interfaces have been added, removed, or changed since
+dnl    the last update, increment LIBABIGAIL_SO_CURRENT, and set
+dnl    LIBABIGAIL_REVISION to 0.
+dnl 
+dnl 3. If any interfaces have been added since the last public release,
+dnl    then increment LIBABIGAIL_SO_AGE.
+dnl 
+dnl 4. If any interfaces have been removed or changed since the last
+dnl     public release, then set LIBABIGAIL_SO_AGE to 0.
+m4_define([libabigail_so_current],  [1])
+m4_define([libabigail_so_revision], [0])
+m4_define([libabigail_so_age],      [0])
+
 AC_INIT([libabigail],
 	[version_major.version_minor],
 	[http://sourceware.org/bugzilla],
@@ -40,12 +67,18 @@ VERSION_MINOR=version_minor
 VERSION_REVISION=0
 ABIXML_VERSION_MAJOR=2
 ABIXML_VERSION_MINOR=1
+LIBABIGAIL_SO_CURRENT=libabigail_so_current
+LIBABIGAIL_SO_REVISION=libabigail_so_revision
+LIBABIGAIL_SO_AGE=libabigail_so_age
 
 AC_SUBST(VERSION_MAJOR)
 AC_SUBST(VERSION_MINOR)
 AC_SUBST(VERSION_REVISION)
 AC_SUBST(ABIXML_VERSION_MAJOR)
 AC_SUBST(ABIXML_VERSION_MINOR)
+AC_SUBST(LIBABIGAIL_SO_CURRENT)
+AC_SUBST(LIBABIGAIL_SO_REVISION)
+AC_SUBST(LIBABIGAIL_SO_AGE)
 
 dnl This VERSION_SUFFIX environment variable is to allow appending
 dnl arbitrary text to the libabigail version string representation.
diff --git a/src/Makefile.am b/src/Makefile.am
index 1591224f..1748f0b8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -47,7 +47,7 @@ libabigail_la_SOURCES += abg-ctf-reader.cc
 endif
 
 libabigail_la_LIBADD = $(DEPS_LIBS) $(FTS_LIBS)
-libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined
+libabigail_la_LDFLAGS = -lpthread -Wl,--as-needed -no-undefined -version-info $(LIBABIGAIL_SO_CURRENT):$(LIBABIGAIL_SO_REVISION):$(LIBABIGAIL_SO_AGE)
 
 CUSTOM_MACROS = -DABIGAIL_ROOT_SYSTEM_LIBDIR=\"${libdir}\"
 
-- 
2.37.2



-- 
		Dodji

      reply	other threads:[~2022-09-06 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 22:26 Ben Woodard
2022-09-06 15:41 ` Dodji Seketeli [this message]

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=87a67cik7w.fsf@seketeli.org \
    --to=dodji@seketeli.org \
    --cc=libabigail@sourceware.org \
    --cc=woodard@redhat.com \
    /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).