ID: 48795 Comment by: jplock at gmail dot com Reported By: gwy...@php.net Status: Verified Bug Type: Compile Failure Operating System: Darwin9 (MacOS X 10.5) PHP Version: 5.3CVS-2009-07-04 (CVS) New Comment:
I'm using OSX 10.5 as well and I'm getting the same error when trying to build PHP 5.3.0 with intl enabled. Undefined symbols: "___gxx_personality_v0", referenced from: ___gxx_personality_v0$non_lazy_ptr in msgformat_helpers.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [libs/libphp5.bundle] Error 1 LDFLAGS="/usr/lib/gcc/i686-apple-darwin9/4.0.1/libstdc++.dylib" export LDFLAGS ./configure \ --disable-all \ --with-libxml-dir=/usr \ --with-apxs2=/usr/local/apache22/bin/apxs \ --with-regex=php \ --with-zend-vm=CALL \ --with-curl=/usr \ --with-curlwrappers \ --with-gd \ --with-gettext=/usr \ --with-iconv \ --with-pear=/usr/local/lib/php \ --with-mysqli=mysqlnd \ --with-pdo-mysql=mysqlnd \ --with-openssl=/usr \ --with-pcre-regex \ --with-zlib-dir=/usr \ --with-xsl=/usr \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-icu-dir=/usr/local \ --enable-tokenizer \ --enable-ctype \ --enable-mbstring \ --enable-session \ --enable-simplexml \ --enable-xml \ --enable-hash \ --enable-libxml \ --enable-dom \ --enable-filter \ --enable-fileinfo \ --enable-bcmath \ --enable-json \ --enable-intl \ --enable-pdo \ --enable-pcntl \ --enable-shmop \ --enable-phar \ --enable-posix \ --enable-sockets Previous Comments: ------------------------------------------------------------------------ [2009-07-04 00:47:46] gwy...@php.net Description: ------------ This is a reference to PECL bug #16575 <http://pecl.php.net/bugs/bug.php?id=16575>. Since intl will shortly be part of core instead of PECL, I feel this bug belongs here. Here's my addition to the issue: This is due to intl/msgformat/msgformat_helpers.cpp being a C++ file and GCC not handling that case cleanly. The exact error is specifically due to GCC not linking to libstdc++. Which is, actually, kinda reasonable since it's been invoked as a plain C compiler. Anyway, you can get around the problem for now by adding "/usr/lib/gcc/i686-apple-darwin9/4.2.1/libstdc++.dylib" (if you're building with gcc-4.2) or "/usr/lib/gcc/i686-apple-darwin9/4.0.1/libstdc++.dylib" (if you're building with gcc-4.0, the default) to your LDFLAGS. That's right, WITHOUT -l or -L. I wouldn't consider this a real solution, but a better solution is pending further research into the subject. Reproduce code: --------------- $ CFLAGS='-arch x86_64' CXXFLAGS='-arch x86_64' LDFLAGS='-arch x86_64' ./configure --enable-intl --with-icu=/path/to/icu $ make Expected result: ---------------- Build complete. Don't forget to run 'make test'. $ Actual result: -------------- Undefined symbols: "___gxx_personality_v0", referenced from: EH_frame1 in msgformat_helpers.o ld: symbol(s) not found collect2: ld returned 1 exit status make: *** [sapi/cgi/php-cgi] Error 1 $ ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=48795&edit=1