libtool passing `-Wl,--whole-archive'
SYSTEM: NetBSD-1.4Y (-current ELF) on DEC Alpha i'm trying to compile PHP4.0RC2 which uses libtool 1.3.4. libtool seems to be passing a -Wl to ld which doesn't recognizes it. /bin/sh /usr/pkg/bin/libtool --silent --mode=link gcc -g -O2 -I/usr/pkg/include -Wall -o libphp4.la -rpath /usr/local/work/php-4.0RC2/libs -L/usr/pkg/lib -L/u sr/pkg/lib/mysql -R /usr/pkg/lib -R /usr/pkg/lib/mysql main.lo internal_functio ns.lo snprintf.lo php_sprintf.lo configuration-parser.lo configuration-scanner.l o safe_mode.lo fopen-wrappers.lo php_realpath.lo alloca.lo php_ini.lo SAPI.lo rf c1867.lo dlist.lo php_content_types.lo strlcpy.lo strlcat.lo mergesort.lo reentr ancy.lo php_variables.lo php_ticks.lo php_virtual_cwd.lo Zend/libZend.la sapi/c gi/libsapi.la regex/libregex.la ext/calendar/libcalendar.la ext/db/libdb.la ex t/dba/libdba.la ext/mysql/libmysql.la ext/pcre/libpcre.la ext/posix/libposix.la ext/session/libsession.la ext/standard/libstandard.la ext/sysvsem/libsysvsem.la ext/sysvshm/libsysvshm.la ext/xml/libxml.la -lgdbm -lmysqlclient -lgdbm -lreso lv -lm -lcrypt -lresolv /usr/bin/ld: unrecognized option `-Wl,--whole-archive' *** Error code 1 Stop. *** Error code 1 # uname -a NetBSD ns01 1.4Y NetBSD 1.4Y (ns01) #2: Sat May 13 02:41:30 PDT 2000 **@ns0 1:/usr/src/sys/arch/alpha/compile/ns01 alpha # ld --version GNU ld 2.9.1 Copyright 1997 Free Software Foundation, Inc. This program is free software; you may redistribute it under the terms of the GNU General Public License. This program has absolutely no warranty. Supported emulations: elf64alpha # automake --version automake (GNU automake) 1.4 Copyright (C) 1999 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Written by Tom Tromey <[EMAIL PROTECTED]> # gcc --version egcs-1.1.2 # gcc --help | grep \Wl -Wl,Pass comma-separated on to the linker # ld --help | grep "\-\-whole\-archive" --no-whole-archive Turn off --whole-archive --whole-archive, -Bforcearchive # ld --help | grep "\-Wl" # (nothing returned)
Re: libtool passing `-Wl,--whole-archive'
At 03:13 PM 5/18/00 -0300, Alexandre Oliva wrote: >On May 18, 2000, Mocha <[EMAIL PROTECTED]> wrote: > > > /bin/sh /usr/pkg/bin/libtool --silent --mode=link gcc -g -O2 > -I/usr/pkg/include > > >Please remove this flag and let us see what libtool prints. For some >reason, it seems to assume it's running GCC for linking, but actually >using ld, so it ``quotes'' the arguments in a way that would cause GCC >to pass them to the linker. in php-4.0RC2 dir ./configure --prefix=/usr/local/install/php-4.0RC2 \ --enable-force-cgi-redirect \ --with-config-file-path=/usr/local/install/php-4.0RC2/lib \ --enable-calendar \ --enable-sysvsem --enable-sysvshm \ --with-gdbm=/usr/pkg \ --with-mysql=/usr/pkg \ --enable-shared=mysql \ --enable-debug last few commands from 'make' ... /bin/sh /usr/pkg/bin/libtool --mode=link gcc -g -O2 -I/usr/pkg/include -Wall - o libphp4.la -rpath /usr/local/work/php-4.0RC2/libs -L/usr/pkg/lib -L/usr/pkg/li b/mysql -R /usr/pkg/lib -R /usr/pkg/lib/mysql main.lo internal_functions.lo snp rintf.lo php_sprintf.lo configuration-parser.lo configuration-scanner.lo safe_mo de.lo fopen-wrappers.lo php_realpath.lo alloca.lo php_ini.lo SAPI.lo rfc1867.lo dlist.lo php_content_types.lo strlcpy.lo strlcat.lo mergesort.lo reentrancy.lo p hp_variables.lo php_ticks.lo php_virtual_cwd.lo Zend/libZend.la sapi/cgi/libsap i.la regex/libregex.la ext/calendar/libcalendar.la ext/db/libdb.la ext/dba/lib dba.la ext/mysql/libmysql.la ext/pcre/libpcre.la ext/posix/libposix.la ext/sessi on/libsession.la ext/standard/libstandard.la ext/sysvsem/libsysvsem.la ext/sysvs hm/libsysvshm.la ext/xml/libxml.la -lgdbm -lmysqlclient -lgdbm -lresolv -lm -l crypt -lresolv mkdir .libs /usr/bin/ld -Bshareable main.lo internal_functions.lo snprintf.lo php_sprintf.l o configuration-parser.lo configuration-scanner.lo safe_mode.lo fopen-wrappers.l o php_realpath.lo alloca.lo php_ini.lo SAPI.lo rfc1867.lo dlist.lo php_content_t ypes.lo strlcpy.lo strlcat.lo mergesort.lo reentrancy.lo php_variables.lo php_ti cks.lo php_virtual_cwd.lo -Wl,--whole-archive Zend/.libs/libZend.al sapi/cgi/.li bs/libsapi.al regex/.libs/libregex.al ext/calendar/.libs/libcalendar.al ext/db/. libs/libdb.al ext/dba/.libs/libdba.al ext/mysql/.libs/libmysql.al ext/pcre/.libs /libpcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/stan dard/.libs/libstandard.al ext/sysvsem/.libs/libsysvsem.al ext/sysvshm/.libs/libs ysvshm.al ext/xml/.libs/libxml.al -Wl,--no-whole-archive -L/usr/pkg/lib -L/usr/ pkg/lib/mysql -lgdbm -lmysqlclient -lgdbm -lresolv -lm -lcrypt -lresolv -lgdbm - lmysqlclient -lgdbm -lresolv -lm -lcrypt -lresolv -lc -o .libs/libphp4.so.0.0 /usr/bin/ld: unrecognized option `-Wl,--whole-archive' *** Error code 1 ---cut--- you can see that '-Wl,--whole-archive' is in the ld param. here is config.guess: ---cut--- To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: config.guess #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999 # Free Software Foundation, Inc. # # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Written by Per Bothner <[EMAIL PROTECTED]>. # The master version of this file is at the FSF in /home/gd/gnu/lib. # Please send patches to <[EMAIL PROTECTED]>. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit system type (host/target name). # # Only a few systems have been added to this list; please add others # (but try to keep the structure clean). # # Use $HOST_CC if defined. $CC may point to a cross-compiler if test x"$CC_FOR_BUILD" = x; then if test x"$HOST_CC" != x; then CC_FOR_BUILD="$HOST_CC" else if test x"$C
Re: libtool passing `-Wl,--whole-archive'
At 05:46 AM 5/20/00 -0300, Alexandre Oliva wrote: >On May 18, 2000, Mocha <[EMAIL PROTECTED]> wrote: > > > SYSTEM: NetBSD-1.4Y (-current ELF) on DEC Alpha > > > i'm trying to compile PHP4.0RC2 which uses libtool 1.3.4. libtool seems > > to be passing a -Wl to ld which doesn't recognizes it. > >Does this patch fix the problem for you? > >Index: ChangeLog >from Alexandre Oliva <[EMAIL PROTECTED]> > > * ltconfig.in (wlarc): Set to empty on netbsd with GNU ld. > >Index: ltconfig.in >=== >RCS file: /home/cvs/libtool/ltconfig.in,v >retrieving revision 1.261 >diff -u -r1.261 ltconfig.in >--- ltconfig.in 2000/04/10 18:39:30 1.261 >+++ ltconfig.in 2000/05/20 08:44:19 >@@ -1088,6 +1088,7 @@ >archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags > ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' > else >archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' >+ wlarc= > fi > ;; i tried something similar to this patch.. and it didn't work. but i applied yours anyway.. and this is the result.. ... mkdir .libs rm -fr .libs/libphp4.la .libs/libphp4.* .libs/libphp4.* /usr/bin/ld -Bshareable main.lo internal_functions.lo snprintf.lo php_sprintf.l o configuration-parser.lo configuration-scanner.lo safe_mode.lo fopen-wrappers.l o php_realpath.lo alloca.lo php_ini.lo SAPI.lo rfc1867.lo dlist.lo php_content_t ypes.lo strlcpy.lo strlcat.lo mergesort.lo reentrancy.lo php_variables.lo php_ti cks.lo php_virtual_cwd.lo --whole-archive Zend/.libs/libZend.al sapi/cgi/.libs/l ibsapi.al regex/.libs/libregex.al ext/calendar/.libs/libcalendar.al ext/db/.libs /libdb.al ext/dba/.libs/libdba.al ext/mysql/.libs/libmysql.al ext/pcre/.libs/lib pcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard /.libs/libstandard.al ext/sysvsem/.libs/libsysvsem.al ext/sysvshm/.libs/libsysvs hm.al ext/xml/.libs/libxml.al --no-whole-archive -L/usr/pkg/lib -L/usr/pkg/lib/ mysql Zend/.libs/libZend.al -lgdbm -lgdbm -lresolv -lresolv sapi/cgi/.libs/libsa pi.al regex/.libs/libregex.al ext/calendar/.libs/libcalendar.al ext/db/.libs/lib db.al ext/dba/.libs/libdba.al ext/mysql/.libs/libmysql.al ext/pcre/.libs/libpcre .al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.li bs/libstandard.al ext/sysvsem/.libs/libsysvsem.al ext/sysvshm/.libs/libsysvshm.a l ext/xml/.libs/libxml.al -lgdbm -lmysqlclient -lgdbm -lresolv -lm -lcrypt -lres olv -lc -o .libs/libphp4.so.0.0 main.lo: file not recognized: File truncated *** Error code 1 Stop. *** Error code 1 -- i think what it's doing now is not passing -Wl to gcc at all during the other phases.
Re: libtool passing `-Wl,--whole-archive'
At 08:14 AM 5/20/00 -0300, Alexandre Oliva wrote: >On May 20, 2000, Mocha <[EMAIL PROTECTED]> wrote: > > > i tried something similar to this patch.. and it didn't work. but i > > applied yours anyway.. and this is the result.. > >Try it on libtool 1.3.4. The patch is doing the right thing, but it >seems that the current CVS tree is broken. Or main.lo is not a valid >object file. yes it works with the 1.3.4 tree. Thanks very much. If you could see that your patch makes it into the cvs tree.. that would be great!
BUG? libtool not passing rpath to ld
does libtool include -rpath's in shared objects? cause i don't see it toward the end when i 'make' in php4rc2. ... (cd . && ln -s php_virtual_cwd.lo php_virtual_cwd.o) /usr/bin/ld -Bshareable main.lo internal_functions.lo snprintf.lo php_sprintf.lo configuration-pa rser.lo configuration-scanner.lo safe_mode.lo fopen-wrappers.lo php_realpath.lo alloca.lo php_ini. lo SAPI.lo rfc1867.lo php_content_types.lo strlcpy.lo strlcat.lo mergesort.lo reentrancy.lo php_va riables.lo php_ticks.lo php_virtual_cwd.lo --whole-archive Zend/.libs/libZend.al sapi/apache/.libs /libsapi.al regex/.libs/libregex.al ext/db/.libs/libdb.al ext/dba/.libs/libdba.al ext/mysql/.libs/ libmysql.al ext/pcre/.libs/libpcre.al ext/posix/.libs/libposix.al ext/session/.libs/libsession.al ext/standard/.libs/libstandard.al ext/xml/.libs/libxml.al --no-whole-archive -L/usr/pkg/lib -L/us r/pkg/lib/mysql -lgdbm -lmysqlclient -lgdbm -lresolv -lm -lcrypt -lresolv -lgdbm -lmysqlclient -lg dbm -lresolv -lm -lcrypt -lresolv -lc -o .libs/libphp4.so.0.0 (cd .libs && rm -f libphp4.so.0 && ln -s libphp4.so.0.0 libphp4.so.0) (cd .libs && rm -f libphp4.so && ln -s libphp4.so.0.0 libphp4.so) (cd .libs && rm -f libphp4.so && ln -s libphp4.so.0.0 libphp4.so) creating libphp4.la (cd .libs && rm -f libphp4.la && ln -s ../libphp4.la libphp4.la) Making all in pear $ ---cut--- and because it can't find all of it's libraries, the php module causes apache to core dump. i'm compiling on netbsd/alpha 1.4y -current (ELF system).
Re: BUG? libtool not passing rpath to ld
At 08:49 PM 5/21/00 -0300, Alexandre Oliva wrote: >On May 21, 2000, Mocha <[EMAIL PROTECTED]> wrote: > > > does libtool include -rpath's in shared objects? > >Not in release 1.3.4. In the CVS tree, there's the hardcode_into_libs >flag that's used to decide whether to do it or not. ok i tested this with the CVS tree and it works if i set it to yes under the case of netbsd. but now i need the CVS tree to work with that patch you sent me regarding passing -Wl. that patch works with libtool 1.3.4 but not CVS tree. any idea why it's broken in CVS? NetBSD 1.4Y/Alpha -current (ELF) GNU ld 2.9.1 gcc --version = egcs-1.1.2 I would like to get this taken care of before PHP4 is released.
Re: BUG? libtool not passing rpath to ld
At 02:00 AM 5/22/00 -0300, Alexandre Oliva wrote: >On May 22, 2000, Mocha <[EMAIL PROTECTED]> wrote: > > > any idea why it's broken in CVS? > >Not yet. I haven't had time to investigate yet :-( thanks for your reply. here is the patch for that Wl and an inter-library dependency bug for NetBSD ELF systems. I think you may have gotten the Wl (since you made it) into CVS, but not the inter-library dependency one. This was patched against 1.3.4. I applied it to my local CVS tree and it patched fine too. --- ltconfig.in_ORIGMon Dec 6 04:09:59 1999 +++ ltconfig.in Sat May 20 11:39:08 2000 @@ -1192,7 +1192,7 @@ archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}- retain-symbols-file $wl$export_symbols -o $lib' else archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' - # can we support soname and/or expsyms with a.out? -oliva + wlarc= fi ;; @@ -1988,6 +1988,9 @@ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else +deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' +file_magic_cmd=/usr/bin/file +file_magic_test_file=`echo /usr/lib/libc.so*` library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname }${release}.so ${libname}.so' soname_spec='${libname}${release}.so$major' dynamic_linker='NetBSD ld.elf_so'
test failed
# make check | grep FAIL FAIL: demo-exec.test FAIL: demo-exec.test FAIL: demo-exec.test FAIL: hardcode.test FAIL: build-relink.test that was on NetBSD-1.4Y/Alpha (ELF) and libtool 1.3.5. how can in find out why the test failed and track down the errors.