Bug 60270 - linking phase should be done by g++ to resolve libstdc++ correctly
Summary: linking phase should be done by g++ to resolve libstdc++ correctly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: php
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Phil Copeland
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-02-23 16:45 UTC by James Manning
Modified: 2007-04-18 16:40 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-05-17 19:14:48 UTC
Embargoed:


Attachments (Terms of Use)

Description James Manning 2002-02-23 16:45:09 UTC
While rebuilding php from srpm, the final linking does a -lstdc++ which 
failed.  Looking in /usr/lib, I noticed a couple of libstdc++ symlinks, but 
never one that actually made for a libstd++.so - I made that symlink (pointed 
it to libstdc++-2.8.0) and the build worked fine.

Comment 1 Jakub Jelinek 2002-02-25 17:05:02 UTC
Nope. You should use g++ to link C++ shared libraries. g++ takes care of adding
necessary -L options to ld. ld -shared shouldn't be used.

Comment 2 James Manning 2002-02-25 17:12:36 UTC
ok - then it's a bug in the php srpm - either way, an RH 7.2 SRPM *should* be 
buildable on RH 7.2, IMHO - I'll try to change the component

Comment 3 James Manning 2002-02-25 17:13:00 UTC
nope, I can't change the component - could you? thanks!

Comment 4 Jakub Jelinek 2002-02-26 12:00:24 UTC
Although it seems weird, since we definitely have built that src.rpm if it
is our src.rpm, I'm reassigning to php.

Comment 5 James Manning 2002-05-17 19:11:57 UTC
still broken in 7.3 - jakub's comment about it needing to g++ looks to be true -
if the gcc in this link line is replaced with g++, everything works fine

/bin/sh /usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent --mode=link
gcc  -I. -I/usr/src/redhat/BUILD/php-4.1.2/
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main
-I/usr/src/redhat/BUILD/php-4.1.2
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2
-I/usr/include/freetype2/freetype -I/usr/include/imap -I/usr/include/mysql
-I/usr/local/include -I/usr/include/pspell -I/usr/include/ucd-snmp
-I/usr/src/redhat/BUILD/php-4.1.2/main -I/usr/src/redhat/BUILD/php-4.1.2/Zend
-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 -mcpu=i686
-fPIC -prefer-non-pic -static  -L/usr/kerberos/lib -o libphp4.la -rpath
/usr/src/redhat/BUILD/php-4.1.2/build-cgi/libs -export-symbols
/usr/src/redhat/BUILD/php-4.1.2/sapi/cgi/php.sym -L/usr/kerberos/lib  stub.lo 
Zend/libZend.la sapi/cgi/libsapi.la main/libmain.la  ext/zlib/libzlib.la
ext/bcmath/libbcmath.la ext/bz2/libbz2.la ext/calendar/libcalendar.la
ext/curl/libcurl.la ext/dba/libdba.la ext/dbx/libdbx.la ext/domxml/libdomxml.la
ext/exif/libexif.la ext/ftp/libftp.la ext/gd/libgd.la ext/gettext/libgettext.la
ext/gmp/libgmp.la ext/iconv/libiconv.la ext/mbstring/libmbstring.la
ext/ncurses/libncurses.la ext/openssl/libopenssl.la ext/pcre/libpcre.la
ext/posix/libposix.la ext/pspell/libpspell.la ext/session/libsession.la
ext/shmop/libshmop.la ext/sockets/libsockets.la ext/standard/libstandard.la
ext/sysvsem/libsysvsem.la ext/sysvshm/libsysvshm.la ext/wddx/libwddx.la
ext/xml/libxml.la ext/yp/libyp.la TSRM/libtsrm.la -lpam -ldl -lexpat -lmm
-lpspell -lncurses -lcrypt -lpam -lgmp -lgd -lfreetype -lpng -lz -ljpeg -lz
-lxml2 -ldb -lgdbm -lcurl -ldl -lcrypto -lssl -lcurl -lbz2 -lz -lcrypt -lssl
-lcrypto -lresolv -lm -ldl -lttf -lfreetype -lpng -ljpeg -lz -lnsl -lresolv -lcrypt
/bin/sh /usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent --mode=link
gcc -I. -I/usr/src/redhat/BUILD/php-4.1.2/
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main
-I/usr/src/redhat/BUILD/php-4.1.2
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2
-I/usr/include/freetype2/freetype -I/usr/include/imap -I/usr/include/mysql
-I/usr/local/include -I/usr/include/pspell -I/usr/include/ucd-snmp
-I/usr/src/redhat/BUILD/php-4.1.2/main -I/usr/src/redhat/BUILD/php-4.1.2/Zend
-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 -mcpu=i686
-fPIC  -L/usr/kerberos/lib -o php -export-dynamic       stub.lo libphp4.la
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make[1]: *** [php] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/php-4.1.2/build-cgi'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.95634 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.95634 (%build)

doing this more "manually"

jmm@jmm /usr/src/redhat/BUILD/php-4.1.2/build-cgi> sudo /bin/sh
/usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent --mode=link gcc -I.
-I/usr/src/redhat/BUILD/php-4.1.2/
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main
-I/usr/src/redhat/BUILD/php-4.1.2
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2
-I/usr/include/freetype2/freetype -I/usr/include/imap -I/usr/include/mysql
-I/usr/local/include -I/usr/include/pspell -I/usr/include/ucd-snmp
-I/usr/src/redhat/BUILD/php-4.1.2/main -I/usr/src/redhat/BUILD/php-4.1.2/Zend
-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 -mcpu=i686
-fPIC  -L/usr/kerberos/lib -o php -export-dynamic stub.lo libphp4.la
/usr/bin/ld: cannot find -lstdc++
jmm@jmm /usr/src/redhat/BUILD/php-4.1.2/build-cgi> sudo /bin/sh
/usr/src/redhat/BUILD/php-4.1.2/build-cgi/libtool --silent --mode=link g++ -I.
-I/usr/src/redhat/BUILD/php-4.1.2/
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/main
-I/usr/src/redhat/BUILD/php-4.1.2
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/Zend -I/usr/include/libxml2
-I/usr/include/freetype2/freetype -I/usr/include/imap -I/usr/include/mysql
-I/usr/local/include -I/usr/include/pspell -I/usr/include/ucd-snmp
-I/usr/src/redhat/BUILD/php-4.1.2/main -I/usr/src/redhat/BUILD/php-4.1.2/Zend
-I/usr/src/redhat/BUILD/php-4.1.2/TSRM 
-I/usr/src/redhat/BUILD/php-4.1.2/build-cgi/TSRM -O2 -march=i386 -mcpu=i686
-fPIC  -L/usr/kerberos/lib -o php -export-dynamic stub.lo libphp4.la
jmm@jmm /usr/src/redhat/BUILD/php-4.1.2/build-cgi> ls -l php
-rwxr-xr-x    1 root     root      1648390 May 17 15:06 php

as noted in the original report, a symlink is another possible workaround, but
I'd tend to think jakub's answer may be better


Comment 6 James Manning 2002-05-17 19:14:42 UTC
since the symlink is definitely ugly, i'm just gonna change the summary line to
better reflect the reality of the bug

Comment 7 Phil Copeland 2002-08-12 18:33:48 UTC
This is all settled in the latest and greatest release.

Closing

Phil
=--=



Note You need to log in before you can comment on or make changes to this bug.