php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19983 Compile/Link failure w/Sablotron
Submitted: 2002-10-18 13:33 UTC Modified: 2002-12-18 11:55 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: dahnke at adobe dot com Assigned:
Status: Not a bug Package: Compile Failure
PHP Version: 4.3.0-pre1 OS: Mac OS X 10.2
Private report: No CVE-ID: None
 [2002-10-18 13:33 UTC] dahnke at adobe dot com
When I try to include Sablotron support, I am unable to 
link without modifying the Makefile. I am trying to build 
on Mac OS X v10.2 (Jaguar) with gcc v3.1.

My configure line looks like this:
./configure \
       --prefix=/DCServers/php_server/php \
       --enable-sablot-errors-descriptive \
      	--with-sablot \
	      --with-xslt-sablot \
	      --enable-xslt \
	      --enable-debug

When I run make I get the following error:
ld: warning -L: directory name (/lib) does not exist
ld: Undefined symbols:
vtable for __cxxabiv1::__class_type_info
vtable for __cxxabiv1::__si_class_type_info
operator delete[](void*)
operator delete(void*)
operator new(unsigned long)
___gxx_personality_v0
operator new[](unsigned long)
std::terminate()
vtable for __cxxabiv1::__vmi_class_type_info
___cxa_pure_virtual
make: *** [libs/libphp4.bundle] Error 1

However, if I edit the Makefile between the configure and 
make steps, such that I add the lstdc++ library to the end 
of the variable ZEND_EXTRA_LIBS everything works. There 
seems to be an ordering problem with the lstdc++ library 
which makes it necessary to have it be the last library 
included before the -o part of the link commands. I tried 
to set various flags on the configure line, like 
ZEND_EXTRA_LIBS or LDFLAGS, to "-lstdc++", but could not 
get the lstdc++ library to be the absolutely last thing 
linked.

Please let me know if I can be of assistance with debugging 
this.


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-18 15:50 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip
 [2002-10-18 16:51 UTC] dahnke at adobe dot com
I tried the latest version. The same problem occurs.
 [2002-10-18 17:10 UTC] sniper@php.net
Which sablotron version?

 [2002-10-18 17:27 UTC] msopacua@php.net
Let's first make the configure line correcT:
please remove:
--enable-sablot
--enable-sablot-errors-descriptive 

These belong to the extinct version of the extension. If you are using the latest snapshot, this options should not list in the:
./configure --help
output.
 [2002-10-18 17:35 UTC] msopacua@php.net
Additionally: which libtool are you using?
In the current CVS version of libtool ('libtool 1.4e'), there are a number of fixes regarding to C++ support.

Additionally - set CFLAGS=-O0 to ensure that gcc 3.x is not breaking code, during it's optimisation.

However - if the work-around you are describing is the only thing that does work, we will look into it.
 [2002-10-27 19:48 UTC] kalowsky@php.net
libtool 1.4.2
gcc 3.1
autoconf 2.5.something

confirmed problem.  Solution?  None at this time, I'd like to open a dialog with an Apple rep about this.  
 [2002-11-18 05:00 UTC] bchesneau at mac dot com
make ./configure --prefix=/usr --with-apxs=/usr/sbin/apxs --mandir=/usr/share/man --infodir=/usr/share/info --with-config-file-path=/etc/httpd --enable-calendar --with-iconv=/usr/local --enable-exif --enable-ftp --enable-wddx --with-xml --with-zlib --with-curl=/usr --with-gd=/usr/local --with-jpeg-dir=/usr/local --with-png-dir=/usr/local --with-imap=../imap-2002.RC10 --with-imap-ssl=/usr --enable-sablot --enable-sablot-errors-descriptive --enable-xslt --with-xslt-sablot=/usr/local --with-mcrypt=/usr/local --with-mhash=/usr/local --with-mysql=/usr/local/mysql --with-expat-dir=/usr/local


modified ZEND_EXTRA_LIBS in Makefile before make

make is ok

but when I did sudo make install :

dyld: /Users/benoitc/build/php-4.3.0RC1/sapi/cli/php Undefined symbols:
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZdaPv
__ZdlPv
__Znwm
___gxx_personality_v0
__ZSt9terminatev
__Znam
__ZTVN10__cxxabiv121__vmi_class_type_infoE
___cxa_pure_virtual
make[1]: *** [install-pear-installer] Trace/BPT trap
make: *** [install-pear] Error 2
 [2002-12-17 04:29 UTC] msopacua@php.net
As the original reporter provides a work-around, I'm re-opening this bug-report, and see if we're able to make some configure hack, that strips all instances of -lstdc++ and adds one to the end of the linking process.
 [2002-12-17 13:57 UTC] monan at acm dot org
I don't think his workaround works... Putting the -lstdc++ 
on the end of the ZEND_EXTRA_LIBS variable enables 
everything to make, but I cannot make install and I 
certainly can't run with Apache... I get similar errors 
that bchesneau@mac.com (above) gets.  I know this is kind 
of a 'me too' response, but I want to emphasize that there 
is NO workaround.  Thanks!

During make install:

Installing PHP CLI binary:        /usr/local/bin/
Installing PEAR environment:      /usr/local/lib/php/
dyld: /usr/local/src/build-php-4.3.0RC3/php-4.3.0RC3/sapi/
cli/php Undefined symbols:
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZdaPv
__ZdlPv
__Znwm
___gxx_personality_v0
__ZSt9terminatev
__Znam
__ZTVN10__cxxabiv121__vmi_class_type_infoE
___cxa_pure_virtual
make[1]: *** [install-pear-installer] Trace/BPT trap
make: *** [install-pear] Error 2
 [2002-12-18 11:55 UTC] msopacua@php.net
The problem __really__ is, combining gcc3 and gcc2 suite, as outlined in this document:
http://fink.sourceforge.net/doc/porting/preparing.php

Secondly - if any warnings/errors occur as mentioned in the document above (libtool stuff), the links to patches for those are provided. PHP already has this covered.

The following works:
1) configure expat, using gcc2 explicetely:
CC=gcc2 \
./configure \
        --prefix=/your/prefix

2) configure libiconv, the same way:
CC=gcc2 \
./configure \
        --prefix=/your/prefix

3) configure Sablotron (tested with 0.97RC2) using:
CC=gcc2 \
CXX=g++2 \
./configure \
        --prefix=/your/prefix \
        --with-expat-prefix=/your/prefix \
        --with-iconv-prefix=/your/prefix

PHP can then be configured, using:
CC=gcc2 \
CXX=g++2 \
./configure \
        --prefix=/your/prefix \
        --disable-cgi \
        --enable-xslt \
        --with-xslt-sablot=/your/prefix \
        --with-expat-dir=/your/prefix \
        --with-iconv-dir=/your/prefix 

I guess the same applies to gcc3, but you have to make sure, that all libs you include, are compiled with gcc3/g++3 then.
 [2002-12-27 15:07 UTC] rwelti at yahoo dot com
Just got the first 4.3.0 release and cannot build
under Solaris due to "line too long" when attempting 
make.  That is followed, of course, with millions of
undefined symbols.

my configure:

./configure \
  --with-apache=/apa/ \
  --with-jpeg-dir=/usr/local \
  --with-zlib-dir=/usr/local \
  --with-jpeg-dir=/usr/local \
  --with-png-dir=/usr/local \
  --with-gd \
  --with-oci8=/export/home/orahome \
  --enable-ftp \
  --enable-sockets \
  --with-pdflib \
  --with-ming >configure.log 2>&1 &
all goes fine until attempt "make"
(both solaris and gnu makes same)

NO DICE.
 [2003-01-22 23:25 UTC] llaguno at rogers dot com
Compile errors with Sablotron during php make on Redhat linux 8.0

I was just wondering if you can help me figure out the following errors 
during php make.  


Note that environment is as follows:

expat-1.95.5-1

sablotron-0.97-1

php-4.2.2-8.0.5 (current, want to upgrade to 4.3.0)

httpd-2.0.40-8 (redhat linux 8.0)

The  problem occurs even after I erased the php-4.2 rpm.
---------------------





 >  cd /usr/local/php/php-4.3.0

 > ./configure --enable-xslt --with-xslt-sablot --with-zlib

 ....

 > make

ext/mysql/libmysql/my_tempnam.o: In function `my_tempnam':

/usr/local/php/php-4.3.0/ext/mysql/libmysql/my_tempnam.c:103: the use of 

`tempnam' is dangerous, better use `mkstemp'

/usr/local/lib/libsablot.so: undefined reference to `operator 

new[](unsigned)'

/usr/local/lib/libsablot.so: undefined reference to `vtable for 

__cxxabiv1::__si_class_type_info'

/usr/local/lib/libsablot.so: undefined reference to `operator delete(void*)'

/usr/local/lib/libsablot.so: undefined reference to `__gxx_personality_v0'

/usr/local/lib/libsablot.so: undefined reference to `__cxa_pure_virtual'

/usr/local/lib/libsablot.so: undefined reference to `vtable for 

__cxxabiv1::__class_type_info'

/usr/local/lib/libsablot.so: undefined reference to `operator 

delete[](void*)'

/usr/local/lib/libsablot.so: undefined reference to `vtable for 

__cxxabiv1::__vmi_class_type_info'

/usr/local/lib/libsablot.so: undefined reference to `operator new(unsigned)'

collect2: ld returned 1 exit status

make: *** [sapi/cgi/php] Error 1




> make install  --> same results as above

I would really appreciate your help.  



Thanks in advance, Manny
 [2003-01-24 15:50 UTC] llaguno at rogers dot com
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-03-24 21:04 UTC] sqlboy at playway dot net
This compile bug is in PHP 4.3.1 as well for the x86 platform. 

I was able to get PHP to build and to run under apache by installing Sablotron 0.98RC2, then condfiguring PHP with --enable-xslt --with-xslt-sablot, then before typing make, I added the -lstdc++ line to ZEND_EXTRA_LIBS in the make file.  After building, apache starts ok.

I'm using gcc 3.2.2, libtool 1.4.1 (1.922.2.34 2001/09/03 01:22:13) and glibc 3.2.1.
 [2003-12-09 17:59 UTC] goose23 at spu dot edu
I have had this problem on a number of different Mac OS 
X configurations, most recently on 10.3 w/ gcc3.3 (the 
one with the dev tools from my panther disk), Sablot
-1.0.1, expat 1.95.5-4 from fink 0.6.2-cvs, and php4-
STABLE-200312092030.

this is my configure script:
./configure --with-expat-dir=/sw --enable-xslt --with-
xslt-sablot=/usr/local

I've added -lstdc++ to my environment (setenv LD_FLAGS 
-lstdc++), to EXTRA_LDFLAGS, EXTRA_LDFLAGS_PROGRAM, 
EXTRA_LIBS, and ZEND_EXTRA_LIB, in all reasonable 
combinations.

I still get errors during sudo make install:

Installing PHP SAPI module:       cgi
Installing PHP CGI into: /usr/local/bin/
Installing PEAR environment:      /usr/local/lib/php/
dyld: /usr/local/src/php4-STABLE-200312092030/sapi/cli/
php Undefined symbols:
__ZSt9terminatev
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZTVN10__cxxabiv121__vmi_class_type_infoE
__ZdaPv
__ZdlPv
__Znam
__Znwm
___cxa_pure_virtual
___gxx_personality_v0
make[1]: *** [install-pear-installer] Trace/BPT trap
make: *** [install-pear] Error 2


I am 99% sure that this is not a gcc2 vs gcc3 issue.  Is 
there anything I can do to test this possibility?  FYI, 
i'm using the same configure script and most software 
versions on OS X as on OpenBSD-3.3: OpenBSD has zero 
problems.
 [2004-01-12 07:59 UTC] dave at xcalibre dot co dot uk
I don't think this defect should be in a "Bogus" state - this is a confirmed defect with either the manner in which PHP or Sablotron is looking for libraries.

PHP can be linked/installed fine using the LD_FLAGS=-lstdc++ environment variable during build time - however as soon as the PHP library is loaded by Apache it dies.

This should either be updated in the documentation for one of these two items.
 [2004-03-04 14:13 UTC] php at munkyboy dot com
I ran into this issue as well. I'm running PHP 4.3.4 and Sablotron 1.0.1. There is a fairly easy fix for this. in "ext/xslt/config.m4" add the line:
PHP_ADD_LIBRARY(stdc++)
somewhere before the line:
PHP_CHECK_LIBRARY(sablot, SablotSetEncoding...

don't forget to run buildconf.
 [2004-03-14 09:11 UTC] dimo at angelhill dot net
Adding the PHP_ADD_LIBRARY(stdc++) to ext/xslt/config.m4 does allow you to compile, however once a php script runs, apache dies with the same error that you get when compiling....

dyld: /usr/sbin/httpd Undefined symbols:
__ZSt9terminatev
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv120__si_class_type_infoE
__ZTVN10__cxxabiv121__vmi_class_type_infoE
__ZdaPv
__ZdlPv
__Znam
__Znwm
___cxa_pure_virtual
___gxx_personality_v0
 [2004-03-25 12:01 UTC] michael at fishnet dot us
I found a thread at the url below that may be of help.

http://archive.gingerall.cz/archives/public/sablot2002/msg02266.html

"I moved the gcc -> c++3 link in /usr/bin aside and created a new link gcc -> g++3 ... it's only used once in the build of sablot 0.96 but this apparently is the problem part."

I just built and installed Sablotron with gcc -> g++3, and it now works as a standalone app.  I then moved the link back to gcc3 and compiled a standalone PHP 4.3.5RC4 that is now working with the Sablotron module.

This is on an OSX 10.2.8 Titanium laptop with the Apple development tools installed.  I installed expat, libxml2, libxslt2, zlib, pcre, js and Sablotron from source. My configuration follows.

./configure \
 --enable-track-vars \
 --enable-ftp \
 --with-mysql \
 --with-expat-dir=/usr/local \
 --with-pcre \
 --with-xml \
 --with-dom \
 --with-dom-xslt \
 --with-dom-exslt \
 --enable-xslt \
 --with-xslt-sablot=/usr \
 --with-sablot-js=/usr/local \
 --with-zlib \
 --with-openssl \
 --disable-debug \
 --disable-debugger
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Nov 24 12:01:33 2024 UTC