On 2009-02-28 12:58, Ralf Wildenhues wrote:
> Hello Török,
>
> thank you for the bug report, analysis, and patch!
>
You are welcome.
> * Török Edwin wrote on Sat, Feb 28, 2009 at 10:33:06AM CET:
>
>> 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,
>>
> [...]
>
>> This happens because libtool has this code around line 5898 in ltmain.sh:
>>
> [...]
>
>> 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.
>>
>
> There is one thing that I don't understand yet: the 'emulate sh' early
> in the libtool script should disable zsh special variables like $path.
> How come that is not happening here?
>
I attached the output of zsh -x, maybe you can figure out what is wrong.
I am not a zsh expert, I only use bash ;)
Best regards,
--Edwin
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
creating target.h - canonical system defines
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for gawk... (cached) gawk
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for ar... ar
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared
libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking for shl_load... no
checking for shl_load in -ldld... no
checking for dlopen... no
checking for dlopen in -ldl... yes
checking whether a program can dlopen itself... yes
checking whether a statically linked program can dlopen itself... no
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking which extension is used for runtime loadable modules... .so
checking which variable specifies run-time module search path... LD_LIBRARY_PATH
checking for the default library search path... /lib /usr/lib /usr/lib/atlas
/usr/local/lib /usr/lib/root /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
checking for library containing dlopen... -ldl
checking for dlerror... yes
checking for shl_load... (cached) no
checking for shl_load in -ldld... (cached) no
checking for dld_link in -ldld... no
checking for _ prefix in compiled symbols... no
checking whether deplibs are loaded by dlopen... yes
checking for argz.h... yes
checking for error_t... yes
checking for argz_add... yes
checking for argz_append... yes
checking for argz_count... yes
checking for argz_create_sep... yes
checking for argz_insert... yes
checking for argz_next... yes
checking for argz_stringify... yes
checking if argz actually works... yes
checking whether libtool supports -dlopen/-dlpreopen... yes
checking for ltdl.h... yes
checking whether lt_dlinterface_register is declared... yes
checking for lt_dladvise_preload in -lltdl... yes
checking where to find libltdl headers...
checking where to find libltdl library... -lltdl
checking for unistd.h... (cached) yes
checking for dl.h... no
checking for sys/dl.h... no
checking for dld.h... no
checking for mach-o/dyld.h... no
checking for dirent.h... yes
checking for closedir... yes
checking for opendir... yes
checking for readdir... yes
checking for strlcat... no
checking for strlcpy... no
checking for multiarch libdir... ${exec_prefix}/lib
checking for ANSI C header files... (cached) yes
checking for C/C++ restrict keyword... __restrict
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking whether FPU byte ordering is bigendian... no
checking whether byte ordering is bigendian... no
checking for a supported version of gcc... ok (4.3.3)
checking for gcc bug PR27603... ok, bug not present
checking for gcc bug PR26763-2... ok, bug not present
checking for valid code generation of CLI_ISCONTAINED... ok, bug not present
checking for gcc bug PR28045... ok, bug not present
checking for gcc bug PR37573... ok, bug not present
checking for ld --version-script... yes
checking for stdint.h... (cached) yes
checking for unistd.h... (cached) yes
checking sys/int_types.h usability... no
checking sys/int_types.h presence... no
checking for sys/int_types.h... no
checking for dlfcn.h... (cached) yes
checking for inttypes.h... (cached) yes
checking sys/inttypes.h usability... no
checking sys/inttypes.h presence... no
checking for sys/inttypes.h... no
checking for memory.h... (cached) yes
checking ndir.h usability... no
checking ndir.h presence... no
checking for ndir.h... no
checking for stdlib.h... (cached) yes
checking for strings.h... (cached) yes
checking for string.h... (cached) yes
checking sys/mman.h usability... yes
checking sys/mman.h presence... yes
checking for sys/mman.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking for sys/stat.h... (cached) yes
checking for sys/types.h... (cached) yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking poll.h usability... yes
checking poll.h presence... yes
checking for poll.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking sys/filio.h usability... no
checking sys/filio.h presence... no
checking for sys/filio.h... no
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking termios.h usability... yes
checking termios.h presence... yes
checking for termios.h... yes
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for off_t... yes
checking size of short... 2
checking size of int... 4
checking size of long... 8
checking size of long long... 8
checking size of void *... 8
checking for bind in -lsocket... no
checking for library containing gethostent... none required
checking for poll... yes
checking for setsid... yes
checking for memcpy... yes
checking for snprintf... yes
checking for vsnprintf... yes
checking for strerror_r... yes
checking for strlcpy... (cached) no
checking for strlcat... (cached) no
checking for strcasestr... yes
checking for inet_ntop... yes
checking for setgroups... yes
checking for initgroups... yes
checking for ctime_r... yes
checking for mkstemp... yes
checking for working mmap... yes
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for getpagesize... yes
checking for MAP_ANON(YMOUS)... MAP_ANONYMOUS
checking for ld used by GCC... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking for shared library run path origin... done
checking check.h usability... yes
checking check.h presence... yes
checking for check.h... yes
checking linking with check... ok
configure: Compiling and linking with check by using
/usr/local/lib/libcheck.so -Wl,-rpath -Wl,/usr/local/lib
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for zlib installation... /usr
checking for inflateEnd in -lz... yes
checking for gzopen in -lz... yes
checking how to link with libbz2... -lbz2
checking for BZ2_bzReadOpen in -lbz2... yes
checking bzlib.h usability... yes
checking bzlib.h presence... yes
checking for bzlib.h... yes
checking for CVE-2008-1372... ok
checking for getaddrinfo... yes
checking for IPv6 support... yes
checking for resolv.h... yes
checking for dn_expand in std libs... no
checking for dn_expand in -lresolv... yes
checking whether setpgrp takes no argument... yes
checking for libiconv_open in -liconv... no
checking for iconv... yes
checking whether in_port_t is defined... yes
checking for in_addr_t definition... yes
checking for mi_stop in -lmilter... yes
checking libmilter/mfapi.h usability... yes
checking libmilter/mfapi.h presence... yes
checking for libmilter/mfapi.h... yes
checking for sched_yield... yes
checking for pthread_yield... yes
checking for gethostbyname_r... yes, and it takes 6 arguments
checking for readdir_r... support disabled
checking for ctime_r... yes, and it takes 2 arguments
checking for socklen_t... yes
checking for clamav in /etc/passwd... yes, user clamav and group clamav
checking for structure packing via __attribute__((packed))... yes
checking for type aligning via __attribute__((aligned))... yes
checking for fd_set... yes, found in sys/select.h
checking default FD_SETSIZE value... 1024
checking whether signed right shift is sign extended... yes
checking for recvmsg... yes
checking for sendmsg... yes
checking for msg_control field in struct msghdr... yes
checking BSD 4.4 / RFC2292 style fd passing... yes
checking ncurses/ncurses.h usability... no
checking ncurses/ncurses.h presence... no
checking for ncurses/ncurses.h... no
configure: unable to compile/link with ncurses
checking ncurses.h usability... yes
checking ncurses.h presence... yes
checking for ncurses.h... yes
checking linking with ncurses... ok
configure: Compiling and linking with ncurses by using -lncurses
configure: creating ./config.status
config.status: creating libltdl/Makefile
config.status: creating libclamav/Makefile
config.status: creating libclamav/lzma/Makefile
config.status: creating clamscan/Makefile
config.status: creating database/Makefile
config.status: creating docs/Makefile
config.status: creating clamd/Makefile
config.status: creating clamdscan/Makefile
config.status: creating clamav-milter/Makefile
config.status: creating freshclam/Makefile
config.status: creating sigtool/Makefile
config.status: creating clamconf/Makefile
config.status: creating etc/Makefile
config.status: creating test/Makefile
config.status: creating unit_tests/Makefile
config.status: creating clamdtop/Makefile
config.status: creating Makefile
config.status: creating clamav-config
config.status: creating libclamav.pc
config.status: creating docs/man/clamav-milter.8
config.status: creating docs/man/clamconf.1
config.status: creating docs/man/clamd.8
config.status: creating docs/man/clamd.conf.5
config.status: creating docs/man/clamdscan.1
config.status: creating docs/man/clamscan.1
config.status: creating docs/man/freshclam.1
config.status: creating docs/man/freshclam.conf.5
config.status: creating docs/man/sigtool.1
config.status: creating docs/man/clamdtop.1
config.status: creating clamav-config.h
config.status: executing depfiles commands
config.status: executing libtool commands