Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 343481 - dev-lang/php-5.3.3-r1 fails to compile on OSX
Summary: dev-lang/php-5.3.3-r1 fails to compile on OSX
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Mac OSX (show other bugs)
Hardware: All OS X
: High normal (vote)
Assignee: Gentoo Prefix
URL: http://bugs.php.net/bug.php?id=48795
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-31 09:18 UTC by coderoar
Modified: 2010-11-04 06:16 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,797.53 KB, text/plain)
2010-10-31 09:31 UTC, coderoar
Details
environment (environment,184.80 KB, text/plain)
2010-10-31 09:31 UTC, coderoar
Details
php-5.3.3-r1.ebuild.patch (php-5.3.3-r1.ebuild.patch,578 bytes, patch)
2010-10-31 09:35 UTC, coderoar
Details | Diff
buildlog (build.log,797.53 KB, text/plain)
2010-11-03 15:02 UTC, coderoar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description coderoar 2010-10-31 09:18:33 UTC
Libtool can't handle C++ files correctly. I have tried adding -lstdc++ into EXTRA_LIBS in Makefile to fix it.

Undefined symbols:
  "___gxx_personality_v0", referenced from:
      ___gxx_personality_v0$non_lazy_ptr in msgformat_helpers.o
     (maybe you meant: ___gxx_personality_v0$non_lazy_ptr)
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [sapi/cgi/php-cgi] Error 1
emake failed
 * ERROR: dev-lang/php-5.3.3-r1 failed:
 *   emake failed
 * 
 * Call stack:
 *              ebuild.sh, line   62:  Called src_compile
 *            environment, line 4921:  Called eblit-run 'src_compile' 'v1'
 *            environment, line 1996:  Called eblit-php-src_compile
 *   src_compile-v1.eblit, line   14:  Called php_sapi_build 'cgi'
 *   src_compile-v1.eblit, line   23:  Called die
 * The specific snippet of code:
 *   	emake || die "emake failed"
 * 
 * If you need support, post the output of 'emerge --info =dev-lang/php-5.3.3-r1',
 * the complete build log and the output of 'emerge -pqv =dev-lang/php-5.3.3-r1'.
 * The complete build log is located at '/Users/l/Gentoo/var/tmp/portage/dev-lang/php-5.3.3-r1/temp/build.log'.
 * The ebuild environment file is located at '/Users/l/Gentoo/var/tmp/portage/dev-lang/php-5.3.3-r1/temp/environment'.
 * S: '/Users/l/Gentoo/var/tmp/portage/dev-lang/php-5.3.3-r1/work/php-5.3.3'

>>> Failed to emerge dev-lang/php-5.3.3-r1, Log file:

>>>  '/Users/l/Gentoo/var/tmp/portage/dev-lang/php-5.3.3-r1/temp/build.log'
Comment 1 coderoar 2010-10-31 09:29:36 UTC
$ emerge --info
Portage 2.2.01.17086-prefix (prefix/darwin/macos/10.5/x86, gcc-4.2.1, unavailable, 9.8.0 i386)
=================================================================
System uname: Darwin-9.8.0-i386-32bit
Timestamp of tree: Sat, 30 Oct 2010 12:11:48 +0000
distcc 2.18.5-Apple.1 i386-apple-darwin9.0 (protocols 1 and 2) (default port 3632) [disabled]
app-shells/bash:     4.1_p7
dev-lang/python:     2.6.5-r2
dev-util/cmake:      2.8.1-r2
sys-devel/autoconf:  2.65-r1
sys-devel/automake:  1.11.1
sys-devel/gcc-config: 1.4.1-r00.2
sys-devel/libtool:   1.5.26-r1, 2.2.10
sys-devel/make:      3.81-r2
Repositories: gentoo_prefix
ACCEPT_KEYWORDS="~x86-macos"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-apple-darwin9"
CFLAGS="-march=nocona -O1 -pipe"
CHOST="i686-apple-darwin9"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/php/apache2-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/cli-php5/ext-active/ /etc/portage /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-march=nocona -O1 -pipe"
DISTDIR="/Users/l/Gentoo/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--alphabetical"
FEATURES="assume-digests binpkg-logs collision-protect distlocks fixlafiles fixpackages news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-dead_strip_dylibs"
MAKEOPTS="-j2"
PKGDIR="/Users/l/Gentoo/usr/portage/packages"
PORTAGE_COMPRESS="lzma"
PORTAGE_COMPRESS_FLAGS="-9 -e"
PORTAGE_CONFIGROOT="/Users/l/Gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/Users/l/Gentoo/var/tmp"
PORTDIR="/Users/l/Gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aac aqua bash-completion bzip2 cjk coreaudio cracklib curl cxx djvu exif expat flac gd gif gmp gnutls iconv icu idn ipv6 jpeg lcms lzma lzo mmx mp3 mpeg ncurses nls objc objc++ ogg pcre pdf perl png prefix python raw readline sasl socks5 sse sse2 ssl svg threads tiff truetype unicode vim-syntax wmf x86-macos xml zlib" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" PHP_TARGETS="php5-2" RUBY_TARGETS="ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_RSYNC_EXTRA_OPTS

$ emerge -pqv =dev-lang/php-5.3.3-r1
[ebuild   R   ] dev-lang/php-5.3.3-r1  USE="(-adabas) -apache2 -bcmath -berkdb (-birdstep) bzip2 -calendar -cdb cgi cjk -cli -concurrentmodphp -crypt ctype curl -curlwrappers (-db2) (-dbmaker) -debug -doc -embed (-empress) (-empress-bcs) -enchant (-esoob) exif fileinfo filter (-firebird) -flatfile -fpm (-frontbase) ftp gd -gd-external -gdbm gmp hash iconv -imap -inifile -interbase intl -iodbc ipv6 json -kerberos -kolab -ldap -ldap-sasl -libedit -mssql mysql -mysqli -mysqlnd nls (-oci8) -oci8-instant-client -odbc -pcntl pdo phar -pic posix -postgres -qdbm readline -recode -sapdb session -sharedext -sharedmem simplexml -snmp -soap -sockets (-solid) -spell -sqlite sqlite3 ssl -suhosin (-sybase-ct) -sysvipc threads -tidy tokenizer truetype unicode -wddx xml xmlreader -xmlrpc xmlwriter -xpm -xsl zip zlib"
Comment 2 coderoar 2010-10-31 09:31:07 UTC
Created attachment 252651 [details]
build.log
Comment 3 coderoar 2010-10-31 09:31:33 UTC
Created attachment 252653 [details]
environment
Comment 4 coderoar 2010-10-31 09:35:17 UTC
Created attachment 252655 [details, diff]
php-5.3.3-r1.ebuild.patch
Comment 5 Fabian Groffen gentoo-dev 2010-10-31 13:42:13 UTC
I'm not sure if this is the right way, usually the compiler adds this itself.  Is the link performed with gcc or ld?  Linking with g++ should do it.
Comment 6 coderoar 2010-10-31 14:40:48 UTC
Maybe it's related to libtool. In the build.log, It seems that libtool controls which compiler to use.
Comment 7 Fabian Groffen gentoo-dev 2010-10-31 15:07:43 UTC
from your buildlog it seems libtool isn't involved, the linking is done using i686-apple-darwin9-gcc, replacing that with i686-apple-darwin9-g++ should do the trick
Comment 8 Fabian Groffen gentoo-dev 2010-10-31 18:54:49 UTC
 [2010-05-24 19:19 UTC] stas@php.net

Also if you change $(CC) to $(CXX) in BUILD_* vars in Makefile it seems to help too. Looks like if you use C++ anywhere in PHP the linker should be C++ or library should be added manually. I'll try to see if I can maybe make configure add needed magic juice there...

this seems the way to go to me, I committed a fix like this, thanks
Comment 9 coderoar 2010-11-03 15:02:33 UTC
Created attachment 253041 [details]
buildlog

But gcc is still been used.
Comment 10 Fabian Groffen gentoo-dev 2010-11-03 19:32:22 UTC
hmmm, so apparently I failed
Comment 11 Fabian Groffen gentoo-dev 2010-11-03 19:39:30 UTC
ok, I put the fix in a code block for USE=mysqli, so it didn't work.

I put it somewhere else now :)

thanks for the feedback
Comment 12 coderoar 2010-11-04 06:16:05 UTC
It will be OK if putting your fix after this line "eblit-run src_prepare v1 ;" that invokes eautoreconf so that 'configure' will be regenerated.