#49267 [Com]: Linking fails for iconv: "Undefined symbols: _libiconv"
| From: | iongion at yahoo dot com | Date: | Sun, 03 Jan 2010 11:48:37 +0000 |
| Subject: | #49267 [Com]: Linking fails for iconv: "Undefined symbols: _libiconv" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-146290@lists.php.net to get a copy of this message | ||
ID: 49267
Comment by: iongion at yahoo dot com
Reported By: s dot rost at ewerk dot com
Status: No Feedback
Bug Type: Compile Failure
Operating System: Mac OSX 10.6 Snow Leopard
PHP Version: 5.3, 6 (2009-08-18)
Assigned To: scottmac
New Comment:
My system is a SNOW LEOPARD 10.6.2
I think we have a final solution. All these problems are generated
because the Makefile is confused by the existence of multiple iconv
library installations, but not only this.
Fixing iconv (please note that these are pretty subjective, but they
are a good start)
Needed elements:
1) gettext - http://ftp.gnu.org/pub/gnu/gettext/gettext-0.17.tar.gz
2) iconv - http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
Unpack both libraries, before running configure, prepare your
environment as follows:
(i assume you have latest xcode)
export MACOSX_DEPLOYMENT_TARGET=10.6; export CFLAGS="-arch i386 -arch
x86_64 -g -Os -pipe -no-cpp-precomp"; export CCFLAGS="-arch i386 -arch
x86_64 -g -Os -pipe"; export CXXFLAGS="-arch i386 -arch x86_64 -g -Os
-pipe" LDFLAGS="-arch i386 -arch x86_64 -bind_at_load"
and then run configure in gettext, leave prefix as it is, make & make
install;
NOW, building iconv will replace existing iconv from apple(it shouldn't
break anything)
./configure --prefix=/usr --enable-shared --enable-static
then:
make
sudo make install
This did it, what i managed to achieve:
1) Replace php 5.3.0 that comes with Snow Leopard, with php 5.3.1
2) Replace php 5.3.0 that comes with Snow Leopard, with php 5.2.12
Managed to install pecl extensions, apc, xdebug, uploadprogress, ming
I am now on php 5.2.12 as i do drupal development and there are some
module issues with php 5.3, but you could easily replace Snow Leo's php
5.3.0 with 5.3.1 and have your own pecl extensions/features enables
Bellow are build scripts that i use to compile php 5.3.1 and php
5.2.12
1) 5.2.12 -> http://dpaste.com/hold/140511/
2) 5.3.1 -> http://dpaste.com/hold/140512/
Good luck and hopefully php will get some better less confused build
scripts.
This the link that made me think and search more
http://blog.yimingliu.com/2009/02/24/missing-library-symbols-while-compiling-php-528/
I have a little more than 0 knowledge of unix build tools, make, conf,
gcc ... i am a php developer, excuse the non-initiated terms.
Previous Comments:
------------------------------------------------------------------------
[2010-01-02 13:41:56] iongion at yahoo dot com
This is the output of make at its last step before throwing the hell
http://dpaste.com/hold/140147/
------------------------------------------------------------------------
[2010-01-02 13:36:06] iongion at yahoo dot com
It does not work for me, same Snow Leopard
I've added all possible combination of fixes
Using the latest php snapshot php5.3-201001012330
http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-
53/patches/iconv.patch
Here is the build script
./configure \
'--with-iconv-dir=/usr' \
'--prefix=/usr' \
'--mandir=/usr/share/man' \
'--infodir=/usr/share/info' \
'--sysconfdir=/private/etc' \
'--with-apxs2=/usr/sbin/apxs' \
'--enable-cli' \
'--with-config-file-path=/etc' \
'--with-libxml-dir=/usr' \
'--with-openssl=/usr' \
'--with-kerberos=/usr' \
'--with-zlib=/usr' \
'--enable-bcmath' \
'--with-bz2=/usr' \
'--enable-calendar' \
'--with-curl=/usr' \
'--enable-exif' \
'--enable-ftp' \
'--with-gd' \
'--with-jpeg-dir=/usr/local' \
'--with-png-dir=/usr/local' \
'--enable-gd-native-ttf' \
'--with-ldap=/usr' \
'--with-ldap-sasl=/usr' \
'--enable-mbstring' \
'--enable-mbregex' \
'--with-mysql=mysqlnd' \
'--with-mysqli=mysqlnd' \
'--with-pdo-mysql=mysqlnd' \
'--with-iodbc=/usr' \
'--enable-shmop' \
'--with-snmp=/usr' \
'--enable-soap' \
'--enable-sockets' \
'--enable-sysvmsg' \
'--enable-sysvsem' \
'--enable-sysvshm' \
'--with-xmlrpc' \
'--with-xsl=/usr' \
'--with-pcre-regex' \
'--with-mcrypt' \
'--with-mhash' \
'--enable-zip' \
'--with-curl' \
'--with-pear'
With iconv dir set to /usr/local, still not working, arghhh
------------------------------------------------------------------------
[2010-01-02 00:57:29] conrad dot tim at gmail dot com
Solved for me by applying the patch provided by Apple mentioned in bug
#48195.
http://www.opensource.apple.com/source/apache_mod_php/apache_mod_php-
53/patches/iconv.patch
------------------------------------------------------------------------
[2010-01-02 00:37:35] conrad dot tim at gmail dot com
This bug remains for me. On Snow Leapoard (10.6.2 Build 10C540) using
php5.3-201001012330 snapshot).
Output ending the make process:
Undefined symbols:
"_libiconv", referenced from:
__php_iconv_strlen in iconv.o
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_appendl in iconv.o
__php_iconv_appendl in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
------------------------------------------------------------------------
[2010-01-02 00:37:24] conrad dot tim at gmail dot com
This bug remains for me. On Snow Leapoard (10.6.2 Build 10C540) using
php5.3-201001012330 snapshot).
Output ending the make process:
Undefined symbols:
"_libiconv", referenced from:
__php_iconv_strlen in iconv.o
_php_iconv_string in iconv.o
_php_iconv_string in iconv.o
__php_iconv_strpos in iconv.o
__php_iconv_appendl in iconv.o
__php_iconv_appendl in iconv.o
_zif_iconv_substr in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_zif_iconv_mime_encode in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
_php_iconv_stream_filter_append_bucket in iconv.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [libs/libphp5.bundle] Error 1
------------------------------------------------------------------------
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
http://bugs.php.net/49267
--
Edit this bug report at http://bugs.php.net/?id=49267&edit=1