Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 258149 - dev-lang/php-5.2.8-r2: failes to compile with pcre USE flag
Summary: dev-lang/php-5.2.8-r2: failes to compile with pcre USE flag
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-08 16:35 UTC by Jeff Rosowski
Modified: 2010-04-21 20:27 UTC (History)
1 user (show)

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


Attachments
emerge --verbose build log (build.log,45.52 KB, text/plain)
2009-02-08 16:38 UTC, Jeff Rosowski
Details
Config log (config.log,244.22 KB, text/plain)
2009-12-03 05:56 UTC, Jeff Rosowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff Rosowski 2009-02-08 16:35:49 UTC
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
Comment 1 Jeff Rosowski 2009-02-08 16:38:08 UTC
Created attachment 181333 [details]
emerge --verbose build log
Comment 2 Rafał Mużyło 2009-02-08 17:31:06 UTC
What is your version of pcre ?
Comment 3 Jeff Rosowski 2009-02-09 04:15:16 UTC
(In reply to comment #2)
> What is your version of pcre ?
> 

libpcre-7.8 with unicode enabled.
Comment 4 Peter Alfredsen (RETIRED) gentoo-dev 2009-02-11 00:14:58 UTC
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?
Comment 5 Jeff Rosowski 2009-02-11 02:13:44 UTC
(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
Comment 6 Peter Alfredsen (RETIRED) gentoo-dev 2009-02-11 23:19:24 UTC
Looks to me like pcre.h doesn't get included somehow or the guard define has somehow been defined.
Comment 7 Jeff Rosowski 2009-05-03 09:08:25 UTC
(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
Comment 8 Oscar Franzen 2009-05-16 09:53:54 UTC
(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

Comment 9 Radek "rush" Senfeld 2009-05-21 12:46:48 UTC
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
Comment 10 Christian Hoffmann (RETIRED) gentoo-dev 2009-05-21 18:18:57 UTC
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).
Comment 11 Christian Hoffmann (RETIRED) gentoo-dev 2009-06-21 23:34:15 UTC
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.
Comment 12 Radek "rush" Senfeld 2009-12-02 15:47:04 UTC
(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
Comment 13 Jeff Rosowski 2009-12-03 05:56:34 UTC
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.
Comment 14 Rafał Mużyło 2009-12-05 04:15:45 UTC
So, are you sure you don't have a stale version in /usr/local
or such ?
Comment 15 Matti Bickel (RETIRED) gentoo-dev 2010-04-21 16:31:23 UTC
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?
Comment 16 Jeff Rosowski 2010-04-21 19:49:45 UTC
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.
Comment 17 Matti Bickel (RETIRED) gentoo-dev 2010-04-21 20:27:24 UTC
Okay, so again sorry for this taking so long and good to hear it works now :)