From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E8108A0556; Thu, 20 Feb 2020 20:55:01 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EA71758C4; Thu, 20 Feb 2020 20:55:00 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 38308B62 for ; Thu, 20 Feb 2020 20:54:59 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 11:54:58 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,465,1574150400"; d="scan'208";a="269718337" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by fmsmga002.fm.intel.com with ESMTP; 20 Feb 2020 11:54:53 -0800 From: Ferruh Yigit To: Thomas Monjalon , Neil Horman , Bruce Richardson Cc: dev@dpdk.org, Ferruh Yigit , ray.kinsella@intel.com, bluca@debian.org, david.marchand@redhat.com, ktraynor@redhat.com Date: Thu, 20 Feb 2020 19:54:53 +0000 Message-Id: <20200220195454.2363094-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] build: fix experimental library versioning X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The problem occurred when workaround that makes soname two digits applied. With this change for the ABI version "20.0.1" the experimental library version become ".so.2001". After workaround removed in ABI version 21.0, the experimental library version will become ".so.210". "2001" is bigger value than "201" although it is a previous version of the library version, this can break the version comparisons. To fix this, introducing a temporary sub level versioning for the experimental libraries, so that minor version comparison will continue to work. After change experimental libraries will follow below versioning: DPDK version ABI version soname library name ------------ ----------- ------ ------------ DPDK 19.11 20.0 .so.0.200 .so.0.200 DPDK 20.02 20.0.1 .so.0.200.1 .so.0.200.1 DPDK 20.05 20.0.2 .so.0.200.2 .so.0.200.2 DPDK 20.11 21.0 .so.0.210 .so.0.210 DPDK 21.02 21.1 .so.0.211 .so.0.211 Note: After workaround removed in DPDK 20.11 and soname switch back to single digit this patch won't work and needs to be updated. Fixes: f26c2b39b271 ("build: fix soname info for 19.11 compatibility") Signed-off-by: Ferruh Yigit --- Cc: Thomas Monjalon Cc: ray.kinsella@intel.com Cc: nhorman@tuxdriver.com Cc: bruce.richardson@intel.com Cc: bluca@debian.org Cc: david.marchand@redhat.com Cc: ktraynor@redhat.com --- config/meson.build | 4 ++-- mk/rte.lib.mk | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/config/meson.build b/config/meson.build index 6c46767e3..d3d2370ce 100644 --- a/config/meson.build +++ b/config/meson.build @@ -31,8 +31,8 @@ abi_version = run_command(find_program('cat', 'more'), # sonames => librte_stable.so.20.0, librte_experimental.so.0.200 abi_va = abi_version.split('.') stable_so_version = abi_va.length() == 2 ? abi_va[0] : abi_va[0] + '.' + abi_va[1] -experimental_abi_version = '0.' + ''.join(abi_va) -experimental_so_version = '0.' + ''.join(stable_so_version.split('.')) +experimental_abi_version = '0.' + abi_va[0] + abi_va[1] + '.' + abi_va[2] +experimental_so_version = experimental_abi_version # extract all version information into the build configuration dpdk_conf.set('RTE_VER_YEAR', pver.get(0).to_int()) diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk index b1a8372cc..682b590db 100644 --- a/mk/rte.lib.mk +++ b/mk/rte.lib.mk @@ -15,8 +15,8 @@ LIBABIVER ?= $(shell cat $(RTE_SRCDIR)/ABI_VERSION) SOVER := $(basename $(LIBABIVER)) ifeq ($(shell grep -s "^DPDK_" $(SRCDIR)/$(EXPORT_MAP)),) # EXPERIMENTAL ABI is versioned as 0.major+minor, e.g. 0.201 for 20.1 ABI -LIBABIVER := 0.$(shell echo $(LIBABIVER) | tr -d '.') -SOVER := 0.$(shell echo $(SOVER) | tr -d '.') +LIBABIVER := 0.$(shell echo $(LIBABIVER) | awk 'BEGIN { FS="." }; { print $$1$$2"."$$3 }') +SOVER := $(LIBABIVER) endif ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) @@ -135,7 +135,9 @@ $(RTE_OUTPUT)/lib/$(LIB): $(LIB) $(Q)cp -f $(LIB) $(RTE_OUTPUT)/lib ifeq ($(CONFIG_RTE_BUILD_SHARED_LIB),y) $(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so/') - $(Q)ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/') + $(Q)if [ $(SOVER) != $(LIBABIVER) ]; then \ + ln -s -f $< $(shell echo $@ | sed 's/\.so.*/.so.$(SOVER)/') ; \ + fi endif # -- 2.24.1