php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75493 Compile falis on PCRE both 7.0 and 7.1 latest
Submitted: 2017-11-07 01:31 UTC Modified: 2020-04-18 16:24 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: samashining at gmail dot com Assigned: cmb (profile)
Status: Closed Package: Compile Failure
PHP Version: 7.1.11 OS: Linux (RHEL 6.9)
Private report: No CVE-ID: None
 [2017-11-07 01:31 UTC] samashining at gmail dot com
Description:
------------
php-7.0.25/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'


I tried to compile with JIT and without JIT, I get errors either way. The errors are in the file above, in different lines. 

ext/pcre/.libs/php_pcre.o: In function `php_free_pcre_cache':
php-7.1.11/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'


If you turn on JIT then you get the following error when running make: 

_SIGNALS   -c /php-7.1.11/ext/pcre/php_pcre.c -o ext/pcre/php_pcre.lo
p/php-7.1.11/ext/pcre/php_pcre.c:68: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘pcre_handle_exec_error’:
/php-7.1.11/ext/pcre/php_pcre.c:93: error: ‘PCRE_ERROR_JIT_STACKLIMIT’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:93: error: (Each undeclared identifier is reported only once
/php-7.1.11/ext/pcre/php_pcre.c:93: error: for each function it appears in.)
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘php_free_pcre_cache’:
/php-7.1.11/ext/pcre/php_pcre.c:113: warning: implicit declaration of function ‘pcre_free_study’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_globals_dtor_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:138: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:139: warning: implicit declaration of function ‘pcre_jit_stack_free’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_info_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:168: error: ‘PCRE_CONFIG_JIT’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘zm_activate_pcre’:
/php-7.1.11/ext/pcre/php_pcre.c:222: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:223: warning: implicit declaration of function ‘pcre_jit_stack_alloc’
/php-7.1.11/ext/pcre/php_pcre.c: In function ‘pcre_get_compiled_regex_cache’:
/php-7.1.11/ext/pcre/php_pcre.c:511: error: ‘PCRE_STUDY_JIT_COMPILE’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:524: error: ‘jit_stack’ undeclared (first use in this function)
/php-7.1.11/ext/pcre/php_pcre.c:525: warning: implicit declaration of function ‘pcre_assign_jit_stack’
make: *** [ext/pcre/php_pcre.lo] Error 1


Test script:
---------------
Here is the compile command in use: 

./configure  --build=x86_64-redhat-linux-gnu \
--host=x86_64-redhat-linux-gnu \
--target=x86_64-redhat-linux-gnu \
--prefix=/opt/php/php7 \
--cache-file=../config.cache \
--with-libdir=lib64 \
--with-config-file-path=/etc \
--with-config-file-scan-dir=/etc/php.d \
--enable-debug \
--disable-rpath \
--without-pear \
--with-freetype-dir=/usr \
--with-png-dir=/usr \
--with-xpm-dir=/usr \
--enable-gd-native-ttf \
--without-gdbm \
--with-gettext \
--with-iconv \
--with-jpeg-dir=/usr \
--with-openssl \
--with-pcre-regex=/usr \
--with-zlib \
--with-layout=GNU \
--enable-exif \
--enable-ftp \
--enable-sockets \
--with-libxml-dir=/usr \
--enable-xml \
--enable-pcntl \
--enable-mbstring=shared \
--enable-mbregex \
--enable-bcmath=shared \
--with-xmlrpc=shared \
--with-mysqli=shared,/usr/lib64/mysql/mysql_config \
--enable-dom=shared \
--with-snmp=shared,/usr \
--enable-soap=shared \
--enable-xmlreader=shared \
--enable-xmlwriter=shared \
--with-curl=shared,/usr \
--enable-json=shared \
--without-readline \
--without-libedit \
--with-oci8=$ORACLE_HOME \
--enable-opcache=no



Expected result:
----------------
I expect it to compile with make successfully. 

Actual result:
--------------
It fails to compile with make when using either the latest 7.1 or 7.0 publicly downloadable source files. 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-11-07 12:58 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2017-11-07 12:58 UTC] cmb@php.net
> --with-pcre-regex=/usr \

Please try without this configuration option to force usage of the
bundled libpcre.  Would that succeed?

Also, what is the PCRE version you have tried to compile against?
 [2017-11-07 13:02 UTC] spam2 at rhsoft dot net
CentOS6:   pcre-7.8-7.el6.x86_64
CentOS7:   pcre-8.32-17.el7.x86_64
Fedora 26: pcre-8.41-3.fc26.x86_64

it makes not much sense compile a recent PHP7.0/PHP7.1 against completly outdated system libraries
 [2017-11-07 13:37 UTC] cmb@php.net
-Status: Feedback +Status: Open
 [2017-11-07 13:37 UTC] cmb@php.net
> it makes not much sense compile a recent PHP7.0/PHP7.1 against
> completly outdated system libraries

ACK.  However, we're still checking for libpcre ≥ 6.6 even in
master[1], what likely has to be adjusted to let ./configure fail
instead of make.

[1] <https://github.com/php/php-src/blob/master/ext/pcre/config0.m4#L44-L46>
 [2017-11-07 13:37 UTC] cmb@php.net
-Status: Assigned +Status: Open -Assigned To: cmb +Assigned To:
 [2017-11-09 15:03 UTC] samashining at gmail dot com
You make a good point, I didn't think about the libraries being that old. 

I did try with the --use-pcre-regex=/usr, I still see php-7.0.25/ext/pcre/php_pcre.c:113: undefined reference to `pcre_free_study'
the same error. 

I agree, it should be caught in the configure, checking for which pcre lib is being used, would have avoided reporting this bug. 

I agree that, my bad, didn't realize how old RHEL 6.x was, but many places still use this, RHEL7x adoption is not as high, not as much certified with it sometimes. 

I was able to use php56 latest available, and went with that, do appreciate your help looking at this.
 [2017-11-09 15:06 UTC] samashining at gmail dot com
If possible, to help others, appreciate you to update configure to check for pcre lib, and possible to express using --with-pcre-regex=/usr as alternative for someone who might run into this, as error when it fails, and then feel free to close this, would be most appreciated.
 [2020-04-18 16:24 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-04-18 16:24 UTC] cmb@php.net
Well, the situation has changed in the meantime.  As of PHP 7.3.0,
libpcre2 is required, and there are appropriate version checks in
the configuration scripts.  Furthermore, if in doubt just use the
default what is to use the bundled libpcre2 (which should be
compatible anyway).  So I think this ticket can be closed.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC