autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Excluding Dynamically Linked Libraries


From: Ralf Wildenhues
Subject: Re: Excluding Dynamically Linked Libraries
Date: Fri, 17 Feb 2006 19:42:15 +0100
User-agent: Mutt/1.5.9i

Hi Chuck,

* Chuck Wolber wrote on Fri, Feb 17, 2006 at 07:06:13PM CET:
> On Fri, 17 Feb 2006, Ralf Wildenhues wrote:
> > 
> > Are you trying to just eliminate the dependency upon the 
> > shared library libbz2 or are you trying to operate out all bz2 
> > functionality from rpm?  If the former, why don't you just link libbz2 
> > statically into the rpm executable?  Same goes for other libraries, of 
> > course.
> 
> I do not want to statically link libbz2 into rpm. I want to remove it. I 
> also do not want it dynamically linked at runtime. The following should 
> not produce any output when I am done:
> 
> ldd ./rpm | grep libbz2
> strings ./rpm | grep libbz2

OK.  So to get an honest answer, you should replace the first test with
   objdump -p ./rpm | grep NEEDED.*libbz2

because if that does not turn up anything, then libbz2 is pulled in by
some other library, not the rpm binary directly.  You can use `ldd' on
the libraries `rpm' depends on directly to find the subtrees you need to
continue searching on, and `objdump -p' to find the actual culprits.
Iterate until you find all culprits.  Rebuild those libraries without
the dependency (including rewriting them, if necessary).  If you have to
change any library interfaces on the way, relink (or rebuild) all direct
users of the library, and so on until you're back up the tree.

Side question: Does
  strings ./rpm | grep libbz2
turn up anything at the moment?

> > Please don't assume others have your build environment;
*snip*

> I think you're "preaching to the converted" here.

Fair enough.  To be a bit more precise: I needed to install `rpm' first
to be able to extract your stuff.  Then I needed to adapt some stuff in
your README because rpm does not interpret `~' as $HOME in ~/.rpmbuild,
which may be due to the rpm version Debian sarge has.  Then more changes
were necessary sometime later, and I stopped.

FWIW, Debian's /usr/bin/rpm does not depend on libbz2 directly, but
indirectly through /usr/lib/librpmio-4.0.4.so, which does depend on it
directly.

> I would never patch 
> generated files for production use. Those patches are for proof of concept 
> only. They simply serve to eradicate all references of bz2 from the source 
> code to prove that it's not some errant code reference I am missing. I'm 
> quite amazed you actually took the time to look into them. They're ugly, 
> ignore them. Just take my word for it that they remove references to bz2 
> in the code in an effort to prove that it's not the RPM source code that 
> is causing the binary to require libbz2 dynamically at runtime.

OK.  Still, it's really not necessary to completely remove configure.ac.

> > Please explain from a higher level point of view what your real 
> > objective is.

> I am trying to build rpm without any references to bz2 in it. Yes, I have 
> posted this to the rpm-devel list. At this point, I do not believe it is 
> an RPM code problem. I think it is an autotools issue.

I'm willing to bet some beer that it's not an autotools issue.  ;-)

> Somewhere, someplace something is happening that causes ldd to show
> that libbz2 is required for linking into rpm at runtime.

Yes.  See above.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]