DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] mk: fix the combined library problems by replacing it with a linker script
Date: Mon, 30 Nov 2015 08:41:02 -0800	[thread overview]
Message-ID: <20151130084102.3f386b50@xeon-e3> (raw)
In-Reply-To: <20151130150343.GA9434@hmsreliant.think-freely.org>

On Mon, 30 Nov 2015 10:03:43 -0500
Neil Horman <nhorman@tuxdriver.com> wrote:

> On Wed, Nov 25, 2015 at 08:08:37AM -0800, Stephen Hemminger wrote:
> > On Wed, 25 Nov 2015 10:38:48 +0200
> > Panu Matilainen <pmatilai@redhat.com> wrote:
> > 
> > > On 11/25/2015 12:46 AM, Stephen Hemminger wrote:
> > > > On Tue, 24 Nov 2015 16:31:17 +0200
> > > > Panu Matilainen <pmatilai@redhat.com> wrote:
> > > >
> > > >> The physically linked-together combined library has been an increasing
> > > >> source of problems, as was predicted when library and symbol versioning
> > > >> was introduced. Replace the complex and fragile construction with a
> > > >> simple linker script which achieves the same without all the problems,
> > > >> remove the related kludges from eg mlx drivers.
> > > >>
> > > >> Since creating the linker script is practically zero cost, remove the
> > > >> config option and just create it always.
> > > >>
> > > >> Based on a patch by Sergio Gonzales Monroy, linker script approach
> > > >> initially suggested by Neil Horman.
> > > >>
> > > >> Suggested-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
> > > >> Suggested-by: Neil Horman <nhorman@tuxdriver.com>
> > > >> Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
> > > >
> > > > But it now means distros have to ship 20 libraries which seems like
> > > > a step back.
> > > 
> > > That's how Fedora and RHEL are shipping it already and nobody has so 
> > > much as noticed anything strange, much less complained about it. 20 
> > > libraries is but a drop in the ocean on a average distro. But more to 
> > > the point, distros will prefer 50 working libraries over one that doesn't.
> > > 
> > > The combined library as it is simply is no longer a viable option. 
> > > Besides just being broken (witness the strange hacks people are coming 
> > > up with to work around issues in it) its ugly because it basically gives 
> > > the middle finger to all the effort going into version compatibility, 
> > > and its also big. Few projects will use every library in DPDK, but with 
> > > the combined library they're forced to lug the 800 pound gorilla along 
> > > needlessly.
> > > 
> > > 	- Panu -
> > > 
> > 
> > Fixing the combined library took less than an hour for us.
> How did you fix the versioning issue?
> 
> Neil

This is what I did. 
Also decided to keep shared library version == major DPDK version
to avoid confusion.


mk: fix when building combined shared library

The DPDK mk file does not set shared object name or version
information as required by Debian.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

--- a/mk/rte.sharelib.mk
+++ b/mk/rte.sharelib.mk
@@ -51,10 +51,10 @@ ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
 LD := $(CC) $(CPU_CFLAGS)
 O_TO_S = $(LD) $(call linkerprefix,$(CPU_LDFLAGS)) \
-	-shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+	-shared $(OBJS) -Wl,-soname,$(LIB_ONE).$(RTE_LIBVERS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
 else
 O_TO_S = $(LD) $(CPU_LDFLAGS) \
-	-shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+	-shared $(OBJS) -soname $(LIB_ONE).$(RTE_LIBVERS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
 endif
 
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
--- a/mk/rte.vars.mk
+++ b/mk/rte.vars.mk
@@ -74,8 +74,10 @@ ifneq ($(BUILDING_RTE_SDK),)
 endif
 
 RTE_LIBNAME := $(CONFIG_RTE_LIBNAME:"%"=%)
+RTE_LIBVERS := $(CONFIG_RTE_LIBVERS:"%"=%)
 ifeq ($(RTE_LIBNAME),)
 RTE_LIBNAME := intel_dpdk
+RTE_LIBVERS := 2
 endif
 
 # RTE_TARGET is deducted from config when we are building the SDK.

  reply	other threads:[~2015-11-30 16:40 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-24 14:31 Panu Matilainen
2015-11-24 14:55 ` Neil Horman
2015-11-24 21:28   ` Aaron Conole
2015-11-24 22:46 ` Stephen Hemminger
2015-11-25  8:38   ` Panu Matilainen
2015-11-25 13:00     ` Neil Horman
2015-11-25 16:08     ` Stephen Hemminger
2015-11-26  8:05       ` Panu Matilainen
2015-11-30 15:03       ` Neil Horman
2015-11-30 16:41         ` Stephen Hemminger [this message]
2015-12-01 12:21           ` Panu Matilainen
2015-12-01 12:36             ` Robie Basak
2015-12-01 13:30               ` Neil Horman
2015-12-08 17:03                 ` Robie Basak
2015-12-09 14:16                   ` Neil Horman
2015-12-01 13:20           ` Neil Horman
2015-12-01 12:37 ` Robie Basak
2015-12-02 11:44   ` Neil Horman
2015-12-03  1:31     ` Ferruh Yigit
2015-12-03  8:11       ` Christian Ehrhardt
2015-12-03 14:59       ` Neil Horman
2015-12-04 17:19 ` Thomas Monjalon
2015-12-07  8:27   ` Christian Ehrhardt
2015-12-07 10:33     ` Martinx - ジェームズ
2016-02-23 20:07 ` Thomas Monjalon
2016-02-24  9:37   ` Panu Matilainen
2016-02-23 22:20 ` [dpdk-dev] [PATCH v2] mk: replace the combined library " Thomas Monjalon
2016-03-01 13:40   ` Thomas Monjalon
2016-03-01 14:48     ` Panu Matilainen
2016-03-02 12:30       ` Panu Matilainen
2016-03-02 12:40         ` Thomas Monjalon
2016-03-02 12:44           ` Panu Matilainen

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=20151130084102.3f386b50@xeon-e3 \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=nhorman@tuxdriver.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 NNTP newsgroup(s).