Edit report at https://bugs.php.net/bug.php?id=63104&edit=1

 ID:                 63104
 Updated by:         johan...@php.net
 Reported by:        maduma at pt dot lu
 Summary:            php fail to build with --enable-intl
-Status:             Open
+Status:             Analyzed
 Type:               Bug
 Package:            Compile Failure
 Operating System:   Solaris 11
 PHP Version:        5.4.7
-Assigned To:        
+Assigned To:        bjori
 Block user comment: N
 Private report:     N

 New Comment:

The actual issue is that we're linking using the C compiler, not the C++ 
compiler. The later would pull the correct C++ libs in.

What we have to do is

1) go through all SAPI config.m4's and modify their linker calls to either use 
CC or CXX depending on i.e. $php_cxx_done
2) remove PHP_ADD_LIBRARY(stdc++) from AC_DEFUN([PHP_REQUIRE_CXX]
3) make sure none of our bundled libs has issues when linked with C++ standard 
libs (especially as they might depend on a lib pulling a different C++ runtime 
in ...)

Then we're done. But step 3 is rather complicated. Better would be if libintl 
itself would pull in the proper C++ runtime but we don't have control over that.

A work-around is to only do step 2 from that list and have the user build the 
intl extension shared. In that case we already use the C++ compiler for linking 
the .so/.dynlib/...

Assigning to Hannes, who added the explicit linkage to libstdc++. Maye he has 
some thoughts or feels brave enough to us C++ for linkage ;-)


Previous Comments:
------------------------------------------------------------------------
[2012-09-19 16:26:23] re...@php.net

similar to https://bugs.php.net/bug.php?id=48795 but different platform.

------------------------------------------------------------------------
[2012-09-19 08:03:59] larue...@php.net

I can not reproduce it:
$php -m | grep intl
intl

$php -r 'proc_open("ls");'
PHP Warning:  proc_open() expects at least 3 parameters, 1 given in Command 
line 
code on line 1

------------------------------------------------------------------------
[2012-09-19 07:46:30] maduma at pt dot lu

Still have problems with intl extention. When i compile 5.4 with intl the 
proc_open() function is not defined anymore

# --with-intl
/usr/php/5.4/bin/php -r 'proc_open();'
PHP Fatal error:  Call to undefined function proc_open() in Command line code 
on line 1

# without intl
/usr/php/5.4/bin/php -r 'proc_open();'
PHP Warning:  proc_open() expects at least 3 parameters, 0 given in Command 
line code on line 1

------------------------------------------------------------------------
[2012-09-18 11:09:26] maduma at pt dot lu

Need also to create libCstd.so and libCrun.so link

ln -s /usr/lib/libCstd.so.1 /usr/lib/libCstd.so
ln -s /usr/lib/libCrun.so.1 /usr/lib/libCrun.so

------------------------------------------------------------------------
[2012-09-18 07:52:33] maduma at pt dot lu

It seems that the build use g++ compiler for c++ and cc for c compiler
I've now defined cc and CC env variable

cc=/opt/solarisstudio12.3/bin/cc CXX=/opt/solarisstudio12.3/bin/CC \
./configure --prefix=/usr/php/5.4 --sysconfdir=/etc/php/5.4 \
--mandir=/usr/php/5.4/man --with-config-file-path=/etc/php/5.4 \
--enable-intl

The build failed also in the linker

/bin/sh /root/php/php-5.4.7/libtool --silent --preserve-dup-deps --mode=link cc 
-export-dynamic -I/usr/include -O -xs -xstrconst -zlazyload -xmemalign=8s     
ext/date/php_date.lo ...  -lstdc++ -lrt -lm -lnsl -lsocket -lxml2 -lz -lm 
-lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lCrun -lCstd -lm -licui18n 
-licuuc -licudata -lm -licuio -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm 
-lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl -lxml2 -lz -lm -lsocket -lnsl  -o 
sapi/cli/php
ld: fatal: library -lstdc++: not found
ld: fatal: file processing errors. No output written to sapi/cli/php

Why do the we need stdc++ (g++ related) !
I just removed -lstdc++ and it working now.

Need to test it now

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=63104


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63104&edit=1

Reply via email to