Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 419519 - Cannot build dev-lang/php[gd] (with GD support)
Summary: Cannot build dev-lang/php[gd] (with GD support)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-03 18:35 UTC by Andrew Udvare
Modified: 2012-10-11 19:00 UTC (History)
2 users (show)

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


Attachments
build log (build.log,277.14 KB, text/plain)
2012-06-03 18:36 UTC, Andrew Udvare
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Udvare 2012-06-03 18:35:12 UTC
So after emerging gd manually due to #419517

Reproducible: Always

Steps to Reproduce:
1. emerge media-libs/gd
2. USE="gd" emerge php
Actual Results:  
In file included from /Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd.c:103:
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c: In function '_php_image_stream_putc':
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:51: error: 'struct gdIOCtx' has no member named 'data'
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c: In function '_php_image_stream_putbuf':
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:58: error: 'struct gdIOCtx' has no member named 'data'
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c: In function '_php_image_stream_ctxfree':
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:67: error: 'struct gdIOCtx' has no member named 'data'
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:68: error: 'struct gdIOCtx' has no member named 'data'
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:69: error: 'struct gdIOCtx' has no member named 'data'
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c: In function '_php_image_output_ctx':
/Users/tatsh/gentoo/var/tmp/portage/dev-lang/php-5.4.3/work/sapis-build/cli/ext/gd/gd_ctx.c:153: error: 'gdIOCtx' has no member named 'data'

Expected Results:  
Should build.

$ emerge --info dev-lang/php
Portage 2.2.01.20430-prefix (prefix/darwin/macos/10.7/x64, gcc-4.2.1, unavailable, 11.4.0 i386)
=================================================================
                        System Settings
=================================================================
System uname: Darwin-11.4.0-i386-64bit
Timestamp of tree: Sun, 03 Jun 2012 05:52:02 +0000
app-shells/bash:      4.2_p28::gentoo_prefix
dev-lang/python:      2.7.3-r2::gentoo_prefix
dev-util/pkgconfig:   0.26::gentoo_prefix
sys-devel/autoconf:   2.69::gentoo_prefix
sys-devel/automake:   1.11.5::gentoo_prefix
sys-devel/gcc-config: 1.5-r2::gentoo_prefix
sys-devel/libtool:    2.4.2::gentoo_prefix
sys-devel/make:       3.82::gentoo_prefix
Repositories: gentoo_prefix
Installed sets: 
ACCEPT_KEYWORDS="~x64-macos"
ACCEPT_LICENSE="*"
CBUILD="x86_64-apple-darwin11"
CFLAGS="-O2 -pipe -march=core2"
CHOST="x86_64-apple-darwin11"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/portage /etc/revdep-rebuild /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=core2"
DISTDIR="/Users/tatsh/gentoo/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs collision-protect distlocks ebuild-locks fixlafiles force-prefix news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_GB.UTF-8"
LDFLAGS="-Wl,-dead_strip_dylibs"
LINGUAS="en_GB"
MAKEOPTS="-j3"
PKGDIR="/Users/tatsh/gentoo/usr/portage/packages"
PORTAGE_CONFIGROOT="/Users/tatsh/gentoo/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/Users/tatsh/gentoo/var/tmp"
PORTDIR="/Users/tatsh/gentoo/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://rsync.prefix.freens.org/gentoo-portage-prefix"
USE="aqua bash-completion cjk coreaudio cracklib cxx mmx mmxext modules ncurses nls objc objc++ prefix readline sse sse2 ssl unicode vim-syntax x64-macos 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" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" 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" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_GB" PHP_TARGETS="php5-4" PYTHON_TARGETS="python2_7" RUBY_TARGETS="ruby18 ruby19" 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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Andrew Udvare 2012-06-03 18:36:23 UTC
Created attachment 314083 [details]
build log
Comment 2 Vincent Huisman 2012-09-11 15:43:40 UTC
Same issue here, with php-5.4.6 on amd64. Some findings:
- php does not depend on gd in the ebuild, it is nowhere in the ebuild and it is not pulled in when emerging php (as #419517)
- php does not depend on gd while running, a working php-5.3.15 continues to work after emerge -C gd:
  # php
  <?php var_dump(imagecreatetruecolor(800, 600));
  ^D
  resource(1) of type (gd)
- php does depend on gd for compilation in the current form, with --with-gd=/usr because it will search for gd there and fail. According to https://bugs.php.net/bug.php?id=55224#1311326045 and according to my own tests, using --with-gd (without =/usr) works. Also according to that bug report, the bundled gd differs from the vanilla one and php itself fails in properly detecting this, so this might be considered a php bug rather than a gentoo bug. Still then it is unclear why any php versions affected by this are marked stable.

I really don't see why so few people are experiencing this, it will either not compile because of missing gd or it will not compile because of present gd. Is there some combination of USE-flags which will not trigger this, although it seems unlikely given the bugreport on php.net?

For now, I "fixed" it with
# sed -e -i.bak "s@\(use_with gd gd\) \${EPREFIX}/usr@\1 @" /usr/portage/dev-lang/php/files/eblits/src_configure-v54.eblit
# ebuild /usr/portage/dev-lang/php/php-5.4.6.ebuild digest
# emerge -1v php
# mv /usr/portage/dev-lang/php/files/eblits/src_configure-v54.eblit{.bak,}
# ebuild /usr/portage/dev-lang/php/php-5.4.6.ebuild digest
Comment 3 Vincent Huisman 2012-09-11 15:45:16 UTC
And my info:

# emerge --info dev-lang/php      
Portage 2.1.11.9 (hardened/linux/amd64, gcc-4.5.4, glibc-2.15-r2, 3.4.2-hardened-r1 x86_64)
=================================================================
                        System Settings
=================================================================
System uname: Linux-3.4.2-hardened-r1-x86_64-AMD_Phenom-tm-_II_X4_905e_Processor-with-gentoo-2.1
Timestamp of tree: Tue, 11 Sep 2012 10:30:01 +0000
app-shells/bash:          4.2_p37
dev-java/java-config:     2.1.11-r3
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/cmake:           2.8.7-r5
dev-util/pkgconfig:       0.27.1
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.68
sys-devel/automake:       1.11.6
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.5.4
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r3
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r2
Repositories: gentoo sunrise dataghost
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA ut2003"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=amdfam10 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /usr/share/openvpn/easy-rsa /var/bind /var/lib/redmine/config"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c /var/lib/redmine/config/locales /var/lib/redmine/config/settings.yml"
CXXFLAGS="-march=amdfam10 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-j5 --load-average=3.00"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp.uni-erlangen.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo ftp://gentoo.tiscali.nl/pub/mirror/gentoo/"
LANG="en_US"
LC_ALL="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="en nl"
MAKEOPTS="-j5 -l5.00"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/sunrise /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="aac acl acpi amd64 apache2 apm bash-completion bcmath berkdb bzip2 clamav cli cracklib crypt cups curl curlwrappers cvs cxx dedicated dri exif fam ffmpeg flac gd gdbm gif gnutls gpm gzip hardened iconv imagemagick imap innodb ipv6 java jpeg justify kerberos lame latex lm_sensors mime mmx modules mp3 mp4 mpeg mudflap multilib mysql mysqli nas ncurses nls nntp nptl offensive ogg openmp pam pax_kernel pcntl pcre pdf perl php png posix postgres pppd python readline samba sasl session skey smp snmp soap sockets sse sse2 ssh ssl subversion svg syslog tcpd threads tiff truetype unicode urandom usb vhosts vnc vorbis x264 xattr xml xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" 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 auth_digest" APACHE2_MPMS="prefork" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" 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="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en nl" PHP_TARGETS="php5-3 php5-4" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="radeon dummy" 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, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON

=================================================================
                        Package Settings
=================================================================

dev-lang/php-5.3.15 was built with the following:
USE="apache2 bcmath berkdb bzip2 calendar cgi cli crypt ctype curl exif fileinfo filter ftp gd gdbm hash iconv imap inifile ipv6 json kerberos mhash (multilib) mysql mysqli mysqlnd nls pcntl pdo phar posix postgres readline session simplexml snmp soap sockets sqlite ssl tokenizer truetype unicode xml xmlreader xmlwriter xsl zip zlib -cdb -cjk -curlwrappers -debug -doc -embed -enchant -firebird -flatfile -fpm (-frontbase) -gmp -intl -iodbc (-kolab) -ldap -ldap-sasl -libedit -mssql -oci8-instant-client -odbc -pic -qdbm -recode -sharedmem -spell -sqlite3 -suhosin (-sybase-ct) -sysvipc -threads -tidy -wddx -xmlrpc -xpm"

dev-lang/php-5.4.6 was built with the following:
USE="apache2 bcmath berkdb bzip2 calendar cgi cli crypt ctype curl exif fileinfo filter ftp gd gdbm hash iconv imap inifile ipv6 json kerberos mhash (multilib) mysql mysqli mysqlnd nls pcntl pdo phar posix postgres readline session simplexml snmp soap sockets ssl tokenizer truetype unicode xml xmlreader xmlwriter xsl zip zlib -cdb -cjk -curlwrappers -debug -doc -embed -enchant -firebird -flatfile -fpm (-frontbase) -gmp -intl -iodbc (-kolab) -ldap -ldap-sasl -libedit -mssql -oci8-instant-client -odbc -pic -qdbm -recode -sharedmem -spell -sqlite3 (-sybase-ct) -sysvipc -threads -tidy -wddx -xmlrpc -xpm"
Comment 4 Daniel Lange 2012-09-11 18:33:26 UTC
The basic issue is a missing void *data; in struct gdIOCtx; as detailed in e.g. https://bugs.php.net/bug.php?id=55224

It's breaking the stable tree, so I propose to increase the priority.
Comment 5 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2012-09-11 18:56:40 UTC
assigning to maintainers then.
Comment 6 Ole Markus With (RETIRED) gentoo-dev 2012-09-11 19:36:46 UTC
This seems to be related to the patch prefix committed earlier today (not their fault tho).

The following fixed the issue for me:
-       $(use_with gd gd ${EPREFIX}/usr)"
+       $(use_with gd gd)"

Not sure why 5.4 had the third param, while 5.3 did not ...
Comment 7 Vincent Huisman 2012-09-12 08:32:45 UTC
Judging by the eblits patch in #433842, it looks like a prefix was added to "just every" use_with. Reverting this for gd will fix the problem then. In either case, it cannot stay this way as long as gd isn't a dependency of php (it will not configure if gd isn't present) and that can't happen until php is fixed or a patch is bundled with either gd or php (or it will not compile).
Comment 8 Ole Markus With (RETIRED) gentoo-dev 2012-09-12 08:40:41 UTC
(In reply to comment #7)
> Judging by the eblits patch in #433842, it looks like a prefix was added to
> "just every" use_with. Reverting this for gd will fix the problem then. In
> either case, it cannot stay this way as long as gd isn't a dependency of php
> (it will not configure if gd isn't present) and that can't happen until php
> is fixed or a patch is bundled with either gd or php (or it will not
> compile).

Aha. That explains it. I fixed the gd bit. Need to see if there are other similar mistakes in that patch as well.
Comment 9 BigBug 2012-09-13 11:13:32 UTC
Yes, please remove this =/usr part of --with-gd=/usr. Not adding the libgd to the deps because the bundled one have more features and is supported (the mainstream version of libgd is like abandored :( ).
Comment 10 Ole Markus With (RETIRED) gentoo-dev 2012-10-11 19:00:00 UTC
Seems to be all fixed now.