Re: [Cooker] Re: failed dependency on libsafe

2001-06-19 Thread Guillaume Cottenceau

Brian J. Murrell [EMAIL PROTECTED] writes:


[...]

 This is because when one uses libsafe in one's LD_PRELOAD (or
 /etc/ld.so.preload) it makes ldd think that it's the binary that

you didn't tell that you used libsafe in LD_PRELOAD in your complain..



-- 
Guillaume Cottenceau - http://mandrakesoft.com/~gc/




[Cooker] Re: failed dependency on libsafe

2001-06-19 Thread Brian J. Murrell

On Tue, Jun 19, 2001 at 02:22:32PM +0200, Guillaume Cottenceau wrote:
 mandrake-cooker [EMAIL PROTECTED] writes:
 
  Hi!
  
  Can somebody tell me why the packages I just rebuild from source rpms
  fail on libsafe dependency? 
  
  $ cat /etc/mandrake-release
  Linux Mandrake release 8.0 (Traktopel) for i586
  
  $ rpm -ivh gftp-2.0.8-1.1mdk.i686.rpm
  error: failed dependencies:
  libsafe.so.2.0 is needed by gftp-2.0.8-1.1mdk
  
  $ rpm -ivh libsafe-2.0-3mdk.i686.rpm
  error: failed dependencies:
  libsafe.so.2.0 is needed by libsafe-2.0-3mdk
  
  $ rpm -Uvh libsafe-2.0-3mdk.i686.rpm
  error: failed dependencies:
  libsafe.so.2.0 is needed by libsafe-2.0-3mdk
  
  $ rpm -qa | grep libsafe
  libsafe-2.0-2mdk
  
  $ rpm -ql libsafe
  /lib/libsafe.so.2
  /lib/libsafe.so.2.0/
  CUT
  
  Thank you very much.
 
 Works here. Removing the current one before upgrading.

No, Guilllaume,

The query is regarding why, when this gentleman builds his own RPMs,
they all have a requirement on libsafe.so.2.0.

This is because when one uses libsafe in one's LD_PRELOAD (or
/etc/ld.so.preload) it makes ldd think that it's the binary that
requires the lib when in fact it is not.  ldd is used in find-requires
to find all of the libs that a binary needs and enter those as
requirements in the RPM.  The preload is fooling ldd and thus
find-requires.

There are two solutions, both of which have been brought up on the rpm
mailing list however the developers there seem to be too stubborn to
admit that this is a problem.  The last time I brought this up they
insisted that it was the build machine that was incorrectly
configured (to use preloads - ~sigh~), not that it was a problem with
RPM's find-requires script.

One of the solutions is to use objdump instead of ldd.  The other is
to exclude the results of $LD_PRELOAD and /etc/ld.so.preload from the
ldd output in find-requires with something like:

--- /usr/lib/rpm/find-requires  Fri Jun 15 02:16:32 2001
+++ /tmp/bjmTue Jun 19 08:12:19 2001
@@ -35,7 +35,7 @@
 [ -r $f -a -x $f ] || continue
 lib64=`if file -L $f 2/dev/null | \
grep ELF 64-bit /dev/null; then echo ()(64bit); fi`
-ldd $f | awk '/=/ {
+ldd $f | grep -v -f /etc/ld.so.preload | awk '/=/ {
if ($1 !~ /libNoVersion.so/  $1 !~ /4[um]lib.so/) {
gsub(/'\''/,\\,$1);
printf %s'$lib64'\n, $1
@@ -49,7 +49,7 @@
 [ -r $f ] || continue
 lib64=`if file -L $f 2/dev/null | \
grep ELF 64-bit /dev/null; then echo ()(64bit); fi`
-ldd $f | awk '/=/ {
+ldd $f | grep -v -f /etc/ld.so.preload | awk '/=/ {
if ($1 !~ /libNoVersion.so/  $1 !~ /4[um]lib.so/) {
gsub(/'\''/,\\,$1);
printf %s'$lib64'\n, $1

Incorporating the exclusion of contents from $LD_PRELOAD is left as an
excercise for the reader.  :-)

b.


-- 
Brian J. Murrell