emerge fails to compile with pcre /bin/sh /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/libtool --silent --preserve-dup-deps --mode=compile i686-pc-linux-gnu-gcc -Iext/pcre/ -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/ -DPHP_ATOM_INC -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/include -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/main -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8 -I/usr/include/libxml2 -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/date/lib -I/usr/include/freetype2 -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/oniguruma -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/TSRM -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/Zend -I/usr/include -march=pentium4 -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -c /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c -o ext/pcre/php_pcre.lo /bin/sh /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/libtool --silent --preserve-dup-deps --mode=compile i686-pc-linux-gnu-gcc -Iext/zlib/ -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/zlib/ -DPHP_ATOM_INC -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/include -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/main -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8 -I/usr/include/libxml2 -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/date/lib -I/usr/include/freetype2 -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/oniguruma -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/libmbfl -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/mbstring/libmbfl/mbfl -I/usr/include/mysql -I/usr/include/pspell -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/TSRM -I/var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/Zend -I/usr/include -march=pentium4 -O2 -pipe -fomit-frame-pointer -D_GNU_SOURCE -c /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/zlib/zlib.c -o ext/zlib/zlib.lo /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'pcre_handle_exec_error': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:63: error: 'PCRE_ERROR_MATCHLIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:63: error: (Each undeclared identifier is reported only once /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:63: error: for each function it appears in.) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:67: error: 'PCRE_ERROR_RECURSIONLIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:71: error: 'PCRE_ERROR_BADUTF8' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'make_subpats_table': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:187: error: 'PCRE_INFO_NAMECOUNT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:196: error: 'PCRE_INFO_NAMETABLE' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:197: error: 'PCRE_INFO_NAMEENTRYSIZE' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'pcre_get_compiled_regex_cache': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:390: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:390: error: 'PCRE_EXTRA_MATCH_LIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:390: error: 'PCRE_EXTRA_MATCH_LIMIT_RECURSION' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'php_pcre_match_impl': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:521: error: storage size of 'extra_data' isn't known /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:572: error: 'PCRE_EXTRA_MATCH_LIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:572: error: 'PCRE_EXTRA_MATCH_LIMIT_RECURSION' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:575: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:576: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'php_pcre_replace_impl': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:956: error: storage size of 'extra_data' isn't known /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:986: error: 'PCRE_EXTRA_MATCH_LIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:986: error: 'PCRE_EXTRA_MATCH_LIMIT_RECURSION' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:989: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:990: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'php_pcre_split_impl': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1421: error: storage size of 'extra_data' isn't known /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1445: error: 'PCRE_EXTRA_MATCH_LIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1445: error: 'PCRE_EXTRA_MATCH_LIMIT_RECURSION' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1448: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1449: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c: In function 'php_pcre_grep_impl': /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1699: error: storage size of 'extra_data' isn't known /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1712: error: 'PCRE_EXTRA_MATCH_LIMIT' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1712: error: 'PCRE_EXTRA_MATCH_LIMIT_RECURSION' undeclared (first use in this function) /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1715: error: dereferencing pointer to incomplete type /var/tmp/portage/dev-lang/php-5.2.8-r2/work/php-5.2.8/ext/pcre/php_pcre.c:1716: error: dereferencing pointer to incomplete type make: *** [ext/pcre/php_pcre.lo] Error 1 make: *** Waiting for unfinished jobs.... * * ERROR: dev-lang/php-5.2.8-r2 failed. * Call stack: * ebuild.sh, line 49: Called src_compile * environment, line 4414: Called src_compile_normal * environment, line 4533: Called php5_2-sapi_src_compile * environment, line 3456: Called die * The specific snippet of code: * emake || die "make failed" * The die message: * make failed Reproducible: Always
Created attachment 181333 [details] emerge --verbose build log
What is your version of pcre ?
(In reply to comment #2) > What is your version of pcre ? > libpcre-7.8 with unicode enabled.
LC_ALL=C grep -r PCRE_EXTRA_MATCH_LIMIT_RECURSION /usr/include/ /usr/include/pcrecpp.h:// which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much pcre /usr/include/pcre.h:#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010 ^Which results do you get?
(In reply to comment #4) > LC_ALL=C grep -r PCRE_EXTRA_MATCH_LIMIT_RECURSION /usr/include/ > /usr/include/pcrecpp.h:// which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit > how much pcre > /usr/include/pcre.h:#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010 > > ^Which results do you get? > same thing LC_ALL=C grep -r PCRE_EXTRA_MATCH_LIMIT_RECURSION /usr/include/ /usr/include/pcrecpp.h:// which uses PCRE_EXTRA_MATCH_LIMIT_RECURSION to limit how much pcre /usr/include/pcre.h:#define PCRE_EXTRA_MATCH_LIMIT_RECURSION 0x0010
Looks to me like pcre.h doesn't get included somehow or the guard define has somehow been defined.
(In reply to comment #6) > Looks to me like pcre.h doesn't get included somehow or the guard define has > somehow been defined. > FYI I get the same error with php-5.2.9-r2
(In reply to comment #7) > (In reply to comment #6) > > Looks to me like pcre.h doesn't get included somehow or the guard define has > > somehow been defined. > > > > FYI I get the same error with php-5.2.9-r2 > (In reply to comment #7) > (In reply to comment #6) > > Looks to me like pcre.h doesn't get included somehow or the guard define has > > somehow been defined. > > > > FYI I get the same error with php-5.2.9-r2 > Here is a very uggly work-around: press ctrl+z when you see the lines about configuration, edit open up ext/pcre/php_pcre.h in your favourite editor and comment in this way: //#if HAVE_BUNDLED_PCRE #include "pcrelib/pcre.h" //#else //#include "pcre.h" //#endif
I was having issues with preg_*: Warning: preg_match: internal pcre_fullinfo() error -3 and realized that it was caused by using external libpcre and not the bundled one. I fixed the problem by deleting this from the ebuild: if use pcre || phpconfutils_usecheck pcre ; then myconf="${my_conf} --with-pcre-dir=/usr" phpconfutils_extension_with "pcre-regex" "pcre" 0 "/usr" fi According to this external libpcre shouldn't be used at all: http://bugs.php.net/bug.php?id=31501
Although this seems to be a workaround, I'm not going to change php back to use the bundled version. It simply does not make sense. Bundling libraries (or well, at least making use of them) is stupid in distribution packages, because it wastes time and more importantly increases the maintainance work (especially security-wise, which is very important). Besides that, using the internal lib has several problems regarding collaboration with other libs or anything which loads php, just search the old bugs. In other words: Reverting to the internal lib is going to fix one problem now and creates two new problems now or in the near future. I'll of course look into getting the issue fixed, which this bug is about (compile failure).
Do you still know whether you've seen this bug with previous versions, btw? If you didn't, it would be way easier to track down. Also please attach config.log, it might contain useful information for finding the problem.
(In reply to comment #11) > Do you still know whether you've seen this bug with previous versions, btw? If > you didn't, it would be way easier to track down. > > Also please attach config.log, it might contain useful information for finding > the problem. > It's still the same. Just tried recent php-5.2.11-r1 and recent libpcre-7.9-r1 and I'm getting following warnings: Warning: preg_match_all() [function.preg-match-all]: Internal pcre_fullinfo() error -3 in file.php on line 111 Warning: preg_match() [function.preg-match]: Internal pcre_fullinfo() error -3 in xtpl.class on line 335
Created attachment 211838 [details] Config log Here is the config log, though the last time I tried to complile PHP, I got a different error: configure: error: The PCRE extension requires PCRE library version >= 6.6 I have libpcre 7.9-r1 installed.
So, are you sure you don't have a stale version in /usr/local or such ?
Sorry this is taking so long. Can you test with php-5.2.13. I can't reproduce this, so need to make guesses at what's causing this. What do emerge -pv php and emerge --info dev-lang/php say?
I can't test this anymore, since moved to a new server and the old one has been wiped. New server I did a fresh install of Gentoo, and everything worked perfectly. Though before I looked and couldn't find any stale copies of PCRE. Obviously not a fix, but hopefully not to many people ran into this bug.
Okay, so again sorry for this taking so long and good to hear it works now :)