Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 469336 - dev-libs/libnl - add symbol versioning to avoid name collisions between rdeps using different slots
Summary: dev-libs/libnl - add symbol versioning to avoid name collisions between rdeps...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Netmon project
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-05-10 18:35 UTC by Ian Stakenvicius (RETIRED)
Modified: 2015-08-19 05:11 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch to add symbol versioning to libnl:1.1 (libnl-1.1-symbol-versions.patch,774 bytes, patch)
2013-05-10 18:36 UTC, Ian Stakenvicius (RETIRED)
Details | Diff
patch to add symbol versioning to libnl:3 (libnl-3-symbol-versions.patch,910 bytes, patch)
2013-05-10 18:38 UTC, Ian Stakenvicius (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Stakenvicius (RETIRED) gentoo-dev 2013-05-10 18:35:11 UTC
Because libnl:1.1 and libnl:3 currently have many symbols with the same name, if a package (like wireshark) happens to depend on libnl:3 and another dependency (say, libpcap) happens to depend on libnl:1.1 , segfaults ensue due to symbol collisions.

Adding symbol versioning based on ${SLOT} to libnl resolves this issue nicely, however, as then both versions of libnl libraries can be loaded at the same time without conflicting.

Patches will be attached to take care of this for both slots currently in portage.
Comment 1 Ian Stakenvicius (RETIRED) gentoo-dev 2013-05-10 18:36:48 UTC
Created attachment 347954 [details, diff]
patch to add symbol versioning to libnl:1.1

The following is for all libnl:1.1 ebuilds ; it applies clean on its own via a simple epatch line in src_prepare():



--- libnl-1.1.3.ebuild  20 Mar 2013 01:26:43 -0000      1.1
+++ libnl-1.1.3.ebuild  10 May 2013 18:36:33 -0000
@@ -20,7 +20,8 @@
        epatch \
                "${FILESDIR}"/${PN}-1.1-vlan-header.patch \
                "${FILESDIR}"/${PN}-1.1-flags.patch \
-               "${FILESDIR}"/${PN}-1.1.3-offsetof.patch
+               "${FILESDIR}"/${PN}-1.1.3-offsetof.patch \
+               "${FILESDIR}"/${PN}-${SLOT}-symbol-versions.patch
        sed -i \
                -e '/@echo/d' \
                Makefile.rules {lib,src,tests}/Makefile || die
Comment 2 Ian Stakenvicius (RETIRED) gentoo-dev 2013-05-10 18:38:56 UTC
Created attachment 347956 [details, diff]
patch to add symbol versioning to libnl:3

The following adds support for symbol versions for libnl:3 ebuilds.  Since the build system changed, this patch is a little more complex but better for future-proofing.  Also note that if necessary the patch can be easily adjusted to take both $MAJOR and $MINOR into account in the symbol version (right now it's just $MAJOR)

Application in src_prepare():

diff -u -B -r1.16 libnl-3.2.14.ebuild
--- libnl-3.2.14.ebuild 1 Jan 2013 19:06:25 -0000       1.16
+++ libnl-3.2.14.ebuild 10 May 2013 18:38:46 -0000
@@ -3,7 +3,7 @@
 # $Header: /var/cvsroot/gentoo-x86/dev-libs/libnl/libnl-3.2.14.ebuild,v 1.16 2013/01/01 19:06:25 armin76 Exp $
 
 EAPI=4
-inherit eutils libtool multilib
+inherit eutils autotools multilib
 
 DESCRIPTION="A library for applications dealing with netlink socket"
 HOMEPAGE="http://www.infradead.org/~tgr/libnl/"
@@ -22,8 +22,9 @@
 "
 
 src_prepare() {
-       elibtoolize
+       epatch "${FILESDIR}"/${PN}-${SLOT%/*}-symbol-versions.patch
        epatch "${FILESDIR}"/${PN}-1.1-vlan-header.patch
+       eautoreconf
 }
 
 src_configure() {
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2013-05-10 19:14:30 UTC
Please report upstream.. this could very well break binaries that look for base symbol versions.
Comment 4 Rick Farina (Zero_Chaos) gentoo-dev 2013-05-10 19:26:21 UTC
Yes, that is the intent. Leaving this open as a tracker/discussion.
Comment 5 Rick Farina (Zero_Chaos) gentoo-dev 2013-05-10 20:36:56 UTC
See also doesn't appear to work for github bugs so here:

https://github.com/tgraf/libnl/issues/38
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-05-11 16:04:51 UTC
(In reply to comment #5)
> See also doesn't appear to work for github bugs so here:
> 
> https://github.com/tgraf/libnl/issues/38

libnl@lists.infradead.org is quite active and responsive.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-08-18 08:44:33 UTC
(In reply to Jeroen Roovers from comment #6)
> (In reply to comment #5)
> > See also doesn't appear to work for github bugs so here:
> > 
> > https://github.com/tgraf/libnl/issues/38
> 
> libnl@lists.infradead.org is quite active and responsive.

I guess that never happened?