php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #21789 GCC 3.2.1 needs stdc++ linked
Submitted: 2003-01-20 23:43 UTC Modified: 2003-01-28 00:31 UTC
From: ron at imperators dot ca Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.3.0 OS: Solaris 8
Private report: No CVE-ID: None
 [2003-01-20 23:43 UTC] ron at imperators dot ca
With GCC 3.2.1 these symbols can be found in libstdc++. When php 4.3.0 is linked with -lsablot, there is no easy way to link it to stdc++, to account for the changes of the locations of these functions in the new GCC API. I would recommend a configure option like --enable-stdc++ to allow the user to link this manually like --enable-libgcc. 

excerpt from compile :

.lo main/internal_functions_cli.lo -lsablot -liconv -lexpat -liconv -lcurl -lcrypt -lresolv -lm -ldl -lnsl -lsocket -lgcc -lcrypt -lcurl -lz -lssl -lcrypto -ldl -lsocket -lnsl -lz  -o sapi/cli/php
Undefined                       first referenced
 symbol                             in file
__cxa_pure_virtual                  /usr/local/lib/libsablot.so
vtable for __cxxabiv1::__si_class_type_info/usr/local/lib/libsablot.so
vtable for __cxxabiv1::__vmi_class_type_info/usr/local/lib/libsablot.so
operator new[](unsigned)            /usr/local/lib/libsablot.so
vtable for __cxxabiv1::__class_type_info/usr/local/lib/libsablot.so
operator delete(void*)              /usr/local/lib/libsablot.so
operator new(unsigned)              /usr/local/lib/libsablot.so
__gxx_personality_v0                /usr/local/lib/libsablot.so
operator delete[](void*)            /usr/local/lib/libsablot.so
ld: fatal: Symbol referencing errors. No output written to sapi/cli/php
collect2: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1
bash-2.03# gcc --version
gcc (GCC) 3.2.1
Copyright (C) 2002 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.

bash-2.03# 


Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-01-21 01:15 UTC] sniper@php.net
Was the sablot compiled also with that same GCC version?

 [2003-01-21 07:30 UTC] ron at imperators dot ca
Yes, Sablotron was compiled with the same version of GCC.
 [2003-01-24 15:56 UTC] llaguno at rogers dot com
Duplicate: bug 19983

Notes: fix for the libsablot.so compile errors during php-4.3.0 make:

[sablotron-0.97 with php-4.3.0 on redhat linux 8.0]

1. rpm -U expat-1.95.5-1.i386.rpm
2. rpm -i sablotron-0.97-1.i386.rpm
3. rpm -i sablotron-devel-0.97-1.i386.rpm
4. rpm -e php   //current version 4.2.2
5. remove the packages dependent on php-4.2.2 if preceding command fails
because of dependencies

6. install httpd-2.0.44
// this fixes the error related to missing file 'instdso'. note that
apache2 

7. add following line to /root/.bashrc
export LDFLAGS='-lstdc++'

// as explained earlier in this bug report, the undefined references are
in the stdc++ libraries. Pavel Hlavnicka from Ginger Alliance suggested
exporting the c++ compiler flag.

7. cd /usr/local/php/php-4.3.0
8. .configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql
--with-zlib --with-dom --with-gd --enable-xslt --with-xslt-sablot
--with-sablot-js
9. make
10. make install
 [2003-01-25 16:54 UTC] ron at imperators dot ca
Thanks for the notes. The fix you described was similar to what I actually did to solve the problem, but since it was happening under Solaris 8, the solution wasn't exactly as described. I would like to suggest the addition of a flag (--enable-stdc++) to the configure script so that the same operation could be achieved more easily by any user having similar problems, regarless of platform, OS or shell. 

Ron.
 [2003-01-28 00:31 UTC] sniper@php.net
Not PHP bug. (further explanation in email)
Use gcc 2.95.2 which is proven to work always. :)

 [2003-03-05 18:43 UTC] shunter at venticon dot com
I added libstdc++ to the Makefile after running configure and did the make, make install...there was no problem with it after that.  Every thing works now.  I did try and do the export on the LDFLAGS, however that does not work. I added the -lstdc++ as extra libs to the makefile and it worked wonders.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Aug 16 01:01:28 2024 UTC