Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 595792 - dev-lang/php-5.6.26-r2: zend_language_parser.h:336:5: error: conflicting types for 'zendparse'
Summary: dev-lang/php-5.6.26-r2: zend_language_parser.h:336:5: error: conflicting type...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PHP Bugs
Depends on:
Reported: 2016-10-01 15:46 UTC by tka
Modified: 2016-10-02 18:59 UTC (History)
1 user (show)

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

build.log (build.log,459.38 KB, text/x-log)
2016-10-01 15:48 UTC, tka

Note You need to log in before you can comment on or make changes to this bug.
Description tka 2016-10-01 15:46:41 UTC
Compilation of php-5.6.26-r2 fails:

/bin/sh /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/libtool --silent --preserve-dup-deps --mode=compile /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/meta_ccld  -Iext/standard/ -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/standard/ -DPHP_ATOM_INC -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/include -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/main -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/date/lib -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/ereg/regex -I/usr/include/libxml2 -I/usr/include/freetype2 -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/mbstring/libmbfl/mbfl -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/TSRM -I/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend  -D_REENTRANT  -I/usr/include -march=native -mtune=native -O2 -fomit-frame-pointer -pipe -pthread -DZTS  -c /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/standard/basic_functions.c -o ext/standard/basic_functions.lo 
In file included from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/standard/basic_functions.c:48:0:
/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_language_parser.h:336:5: error: conflicting types for 'zendparse'
 int zendparse (void);
In file included from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_globals.h:28:0,
                 from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_compile.h:431,
                 from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_modules.h:26,
                 from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_API.h:26,
                 from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/main/php.h:39,
                 from /var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/ext/standard/basic_functions.c:22:
/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_globals_macros.h:35:5: note: previous declaration of 'zendparse' was here
 int zendparse(void *compiler_globals);
make: *** [Makefile:1017: ext/standard/basic_functions.lo] Error 1
 * ERROR: dev-lang/php-5.6.26-r2::gentoo failed (compile phase):
 *   emake failed

# emerge -pqv '=dev-lang/php-5.6.26-r2::gentoo'
[ebuild     U ] dev-lang/php-5.6.26-r2 [5.6.26] USE="apache2 berkdb bzip2 cli crypt ctype fileinfo filter gd gdbm gmp hash iconv ipv6 json mysql mysqli opcache phar posix readline session simplexml ssl threads tokenizer truetype unicode xml zlib -bcmath -calendar -cdb -cgi -cjk -curl -debug -embed -enchant -exif (-firebird) -flatfile -fpm -frontbase -ftp -imap -inifile -intl -iodbc -kerberos -ldap -ldap-sasl -libedit -libmysqlclient -libressl -mhash -mssql -nls -oci8-instant-client -odbc -pcntl -pdo -postgres -qdbm -recode (-selinux) -sharedmem -snmp -soap -sockets -spell -sqlite -sybase-ct -systemd -sysvipc -tidy -vpx -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xslt -zip"
Comment 1 tka 2016-10-01 15:48:08 UTC
Created attachment 448692 [details]

# emerge --info '=dev-lang/php-5.6.26-r2::gentoo'
Portage 2.3.1 (python 3.4.5-final-0, hardened/linux/x86, gcc-5.4.0, glibc-2.23-r2, 4.7.6 i686)
                         System Settings
System uname: Linux-4.7.6-i686-Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-2.3
KiB Mem:     2037608 total,    446732 free
KiB Swap:   16777212 total,  16764764 free
Timestamp of repository gentoo: Sat, 01 Oct 2016 14:30:01 +0000
sh bash 4.4
ld GNU ld (Gentoo 2.26.1 p1.0) 2.26.1
app-shells/bash:          4.4::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.0-r1::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.6.2::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.1::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r2::gentoo
sys-devel/automake:       1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.26.1::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.7::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r2::gentoo

    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000

    location: /usr/local/portage
    masters: gentoo
    priority: 0

CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -pipe"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.6/ext-active/ /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php5.6/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php5.6/ext-active/ /etc/php/cli-php7.0/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"
CXXFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -pipe"
EMERGE_DEFAULT_OPTS="--quiet-build=n --with-bdeps=y"
FCFLAGS="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs cgroup collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=i686 -O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
USE="X a52 acl acpi alsa apache2 berkdb bzip2 cairo caps cdda cddb cdparanoia cli cracklib crypt cxx dbus dri dts dvd fam ffmpeg fftw flac fontconfig gd gdbm gif gimp gmp gnutls gtk hardened iconv icu idn ipv6 java jpeg lame lcms libnotify mad matroska mmap mmx modules mp3 mpeg ncurses nptl ogg opengl openmp pam pcre php pic pie png policykit ppds readline sasl sdl seccomp session sse sse2 ssl ssp startup-notification svg tcpd theora threads tiff truetype udev udisks unicode upower vorbis x264 x86 xattr xcb xml xtpax xv xvid zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd 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 author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" 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 ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby20 ruby21" USERLAND="GNU" VIDEO_CARDS="i915 intel" XFCE_PLUGINS="logout menu trash" 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"
Comment 2 Michael Orlitzky gentoo-dev 2016-10-01 21:48:17 UTC
This is somehow relevant, I just don't know how yet:
Comment 3 Michael Orlitzky gentoo-dev 2016-10-01 21:52:14 UTC
Another one from the graveyard, bug #512450.
Comment 4 Michael Orlitzky gentoo-dev 2016-10-02 01:44:33 UTC
This is probably related to adding >=bison-3.0.1 to DEPEND in php-5.2.26-r1, but I can't reproduce the problem (I've been trying all day). I may need some help from you guys, otherwise I can revert that change, but I'm not sure that reverting it would be a long-term fix.

The main reason why I think that the change in -r1 should be harmless and why reverting it wouldn't help is that bison *should not be used* to build PHP. In -r1, I added it only to eliminate a warning at build time. I can imagine only a few cases:

  * You didn't have bison installed until the -r1 pulled it in. That means that
    bison was never being used, and having >=bison 3.0.4-r1 should make no

  * Bison was installed, but not being used to build PHP. The new dependency
    should make no difference.

  * Bison was installed incidentally and being used to build PHP. Then,
    bison-3.0.4-r1 went stable on amd64 in February, and x86 in June. You
    would've already had the same version installed that is causing problems
    with php-5.6.26-r2... why are they just showing up now?

From the build.log attached to this bug, it looks like bison *is* being used for some reason. Here's the suspicious line:

/var/tmp/portage/dev-lang/php-5.6.26-r2/work/sapis-build/cli/Zend/zend_language_parser.y:47.1-12: warning: deprecated directive, use ‘%pure-parser’ [-Wdeprecated]

That is precisely what is output when you call "yacc" on "zend_language_parser.y". But, zend_language_parser.y is only used to generate zend_language_parser.c, and that file should already be there!

mjo@gantu ~/src $ cp $REPOS/../distfiles/php-5.6.26.tar.xz ./
mjo@gantu ~/src $ tar -xf php-5.6.26.tar.xz
mjo@gantu ~/src $ ls php-5.6.26/Zend/zend_language_parser.c
-rw-r--r-- 1 mjo mjo 264K 2016-09-15 17:43 php-5.6.26/Zend/zend_language_parser.c

So, I don't know why bison is being invoked at all. It might have something to do with the fact that I modified Zend/acinclude.m4 in the -r1, but I don't see that anything depends on that file in the build system. And then why can't I reproduce the problem?

Those of you who can reproduce it: is there any way you can kill the build before it crashes, and check the timestamps on Zend/zend_language_parser.y and Zend/zend_language_parser.c? The .c file should have a later stamp than the .y file, otherwise Make will indeed try to regenerate it.

I'm open to any other suggestions or flaws in my reasoning... or I may just have to revert that fix. Of course, bison-3.x is stable and you likely already have it installed, so I have no idea how that could help...
Comment 5 Michael Orlitzky gentoo-dev 2016-10-02 02:23:34 UTC
It turns out, I can reproduce this, sort of. In my builds, bison-3.0.4-r1 is being used, but it doesn't cause problems for whatever reason. But the good news is, that let me investigate how to stop it from being used.

I think I've found the problem, and it came down to a "cp -r" vs. "cp -a". If we preserve the upstream timestamps, the build system should be smart enough to not use bison. With "cp -r", though, the timestamps were getting clobbered and that could trick the build system into regenerating the parsers.

I just pushed the fix in php-5.6.26-r2 and php-7.0.11-r2. After a few hours, it should show up on the mirrors. You can tell if you have the fixed version by checking for "cp -r" in the ebuild; you should find "cp -a" instead.

Why patch php-7.x too? Well, bison shouldn't be needed -- all we're doing is wasting time regenerating the same files that we already have. By fixing the timestamps, the parsers won't be regenerated, and the build will go faster. Future problems like this will also be avoided if bison-4.x ever manifests.

I'll wait to hear that it works from a few people before closing this, but with "cp -a", bison is not being used on my machine.
Comment 6 Jouni Kosonen 2016-10-02 08:23:07 UTC
(In reply to Michael Orlitzky from comment #5)
> I just pushed the fix in php-5.6.26-r2 and php-7.0.11-r2. After a few hours,
> it should show up on the mirrors. You can tell if you have the fixed version
> by checking for "cp -r" in the ebuild; you should find "cp -a" instead.
> I'll wait to hear that it works from a few people before closing this, but
> with "cp -a", bison is not being used on my machine.

I can confirm that with the "cp -a" -version zend_language_parser.y no longer makes an appearance in the log file and the emerge completes successfully here.
Comment 7 Thomas Capricelli 2016-10-02 08:36:08 UTC
i can confirm as well
Comment 8 Michael Orlitzky gentoo-dev 2016-10-02 13:30:24 UTC
Great, thanks. I wonder how many bison bugs we've had over the years that could have been fixed by changing a single character.
Comment 9 Thomas Capricelli 2016-10-02 18:59:03 UTC
Thanks to you Michael :-)