[pacman-dev] libalpm linked against libarchive/libfetch deps (was: SyncFirst and dependencies)
archlinux at cryptocrack.de
Sat Mar 19 16:27:14 EDT 2011
On Sat, Mar 19, 2011 at 11:38:13AM +0100, Xavier Chantry wrote:
> On Sat, Mar 19, 2011 at 10:36 AM, Xavier Chantry
> <chantry.xavier at gmail.com> wrote:
> > On Fri, Mar 18, 2011 at 3:18 PM, Lukas Fleischer
> > <archlinux at cryptocrack.de> wrote:
> >> Well, it actually is a bit more than just a wrong dependency. ioni and
> >> me figured that libalpm 6.0.0 is linked against all libfetch and
> >> libarchive dependencies as well whereas 5.0.3 isn't, so there must have
> >> been some changes in the build system causing these trouble. I `git
> >> bisect`'ed the commit that introduced this regression. f489e969 
> >> includes autotools upgrades and probably some more changes which seem to
> >> trigger this. Maybe someone else can have a closer look (I unfortunately
> >> don't have any more time and this is a rather large commit).
> >> I added these information to the related ticket  as well.
> >>  http://projects.archlinux.org/pacman.git/commit/?id=f489e969
> >>  https://bugs.archlinux.org/task/23325
> > This commit definitely changes the command line.
> > All deps coming from $(pkg-config --libs --static libarchive) appear
> > after /usr/lib/libarchive.so
> > After :
> > make.log:libtool: link: gcc -std=gnu99 -shared -fPIC -DPIC
> > .libs/add.o .libs/alpm.o .libs/alpm_list.o .libs/backup.o
> > .libs/be_files.o .libs/be_package.o .libs/cache.o .libs/conflict.o
> > .libs/db.o .libs/delta.o .libs/deps.o .libs/dload.o .libs/error.o
> > .libs/group.o .libs/handle.o .libs/log.o .libs/package.o
> > .libs/remove.o .libs/sync.o .libs/trans.o .libs/util.o .libs/version.o
> > -lfetch -lssl /usr/lib/libarchive.so -lacl -lattr -lexpat -llzma
> > -lbz2 -lz -lcrypto -O2 -Wl,--hash-style=gnu -Wl,--as-needed
> > -Wl,-soname -Wl,libalpm.so.5 -o .libs/libalpm.so.5.0.1
> > Before :
> > make-good.log:gcc -std=gnu99 -shared .libs/add.o .libs/alpm.o
> > .libs/alpm_list.o .libs/backup.o .libs/be_files.o .libs/be_package.o
> > .libs/cache.o .libs/conflict.o .libs/db.o .libs/delta.o .libs/deps.o
> > .libs/dload.o .libs/error.o .libs/group.o .libs/handle.o .libs/log.o
> > .libs/package.o .libs/remove.o .libs/sync.o .libs/trans.o .libs/util.o
> > .libs/version.o -lfetch -lssl /usr/lib/libarchive.so
> > -Wl,--hash-style=gnu -Wl,--as-needed -Wl,-soname -Wl,libalpm.so.5 -o
> > .libs/libalpm.so.5.0.1
> still did not get to the bottom of this, but all these libarchive deps
> comes from libarchive.la :
> # Libraries that this one depends upon.
> dependency_libs=' -lacl -lattr -lexpat -llzma -lbz2 -lz -lcrypto'
> This is needed for a static build of pacman, but an alternative is to
> use pkg-config --static --libs libarchive somewhere in the Makefile,
> which gives the same dep list.
> Anyway, removing the .la file 'fixes' the problem, but well ...
Yes, this definitely is a libtool issue. It just seems to link all
indirect library dependencies. We can circumvent this by linking with
"-Wl,--as-needed" but I'm not sure whether this is a valid workaround
(especially since I'm not sure how this will affect other platforms).
I will submit that patch for further testing tho.
More information about the pacman-dev