Package: libtool
Version: 2.2.6a-1
Severity: normal
Tags: patch

libtool2.2.6a, when run under zsh, adds bogus directories to linker lines:

/usr/local/bin/zsh ../libtool --tag=CC    --mode=link gcc  -g -O2  -module
-thread-safe  -version-info 6:0:0  -no-undefined
-Wl,--version-script,../libclamunrar_iface/libclamunrar_iface.map  -o
libclamunrar_iface.la -rpath /usr/local/lib/elf unrar_iface.lo libclamunrar.la
-lz

libtool: link: gcc -shared  .libs/unrar_iface.o   -Wl,-rpath
-Wl,/tmp/clamav-0.95rc1/libclamav/.libs -Wl,-rpath -Wl,/usr/local/lib/elf
./.libs/libclamunrar.so /usr/local/bin -lz  -Wl,--version-script
-Wl,../libclamunrar_iface/libclamunrar_iface.map   -Wl,-soname
-Wl,libclamunrar_iface.so.6 -o .libs/libclamunrar_iface.so.6
/usr/local/bin: file not recognized: File format not recognized

Notice that /usr/local/bin got added to the linker line.
See https://wwws.clamav.net/bugzilla/show_bug.cgi?id=1434 for more details,
I have reproduced the bug running the attached libtool under zsh on Debian,
I had /usr/lib/ccache added to the linker line (which is my first entry in
$PATH)

This happens because libtool has this code around line 5898 in ltmain.sh:
for deplib in $dependency_libs; do
case $deplib in
              -L*) path="$deplib" ;;
              *.la)
                   ... sets path ...
                   ;;
esac
case " $deplibs " in
*" $path "*) ;;
*) deplibs="$path $deplibs" ;;

However "path" is not assigned a value when deplib is something like '-lz'.
When run under bash this is not a problem, $path will be the empty string,
however when run under zsh, it will be the first component of $PATH, which is a
directory, and will cause link failure.

This can be fixed by applying the patch below:

index b36c4ad..554c74a 100755
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -5944,6 +5944,7 @@ func_mode_link ()
                  path="-L$absdir"
                fi
                ;;
+               *) path="";;
              esac
              case " $deplibs " in
              *" $path "*) ;;


-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28.3 (SMP w/4 CPU cores; PREEMPT)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libtool depends on:
ii  autotools-dev                 20080123.2 Update infrastructure for config.{
ii  bcc [c-compiler]              0.16.17-3  16-bit x86 C compiler
ii  cpp                           4:4.3.2-3  The GNU C preprocessor (cpp)
ii  file                          4.26-2     Determines file type using "magic"
ii  gcc [c-compiler]              4:4.3.2-3  The GNU C compiler
ii  gcc-3.4 [c-compiler]          3.4.6-9    The GNU C compiler
ii  gcc-4.1 [c-compiler]          4.1.2-25   The GNU C compiler
ii  gcc-4.2 [c-compiler]          4.2.4-6    The GNU C compiler
ii  gcc-4.3 [c-compiler]          4.3.3-4    The GNU C compiler
ii  libc6-dev [libc-dev]          2.9-2      GNU C Library: Development Librari

Versions of packages libtool recommends:
ii  libltdl7-dev                  2.2.6a-1   A system independent dlopen wrappe

Versions of packages libtool suggests:
ii  autoconf                      2.61-8     automatic configure script builder
ii  automake [automaken]          1:1.10.1-3 A tool for generating GNU Standard
ii  automake1.7 [automaken]       1.7.9-9    A tool for generating GNU Standard
pn  gcj                           <none>     (no description available)
pn  gfortran | fortran95-compiler <none>     (no description available)
pn  libtool-doc                   <none>     (no description available)

-- no debconf information



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to