php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65207 OPCache can't be compiled with SolarisStudio
Submitted: 2013-07-05 02:07 UTC Modified: 2013-10-04 20:47 UTC
Votes:12
Avg. Score:3.9 ± 0.8
Reproduced:11 of 12 (91.7%)
Same Version:5 (45.5%)
Same OS:6 (54.5%)
From: reh at hebis dot uni-frankfurt dot de Assigned:
Status: Open Package: Compile Failure
PHP Version: 5.5.0 OS: Solaris / Illumos
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: reh at hebis dot uni-frankfurt dot de
New email:
PHP Version: OS:

 

 [2013-07-05 02:07 UTC] reh at hebis dot uni-frankfurt dot de
Description:
------------
Configure tries to define a macro for the os dependent structure of flock. (lines 64988 to 65007)
Using solarisstudio 12.3 as compiler, non of the pattern matches and configure suggests to disable OPCache
Not really knowing what I'm doing, I tried to patch the line 64991
From "# elif defined(__svr4__)" 
to   "# elif defined(__svr4__) || defined(__SVR4)"
This workaround is poor I know, but it seems to work, configure generates the Makefiles. 
The same construct can be found in ext/opcache/ZendAccelerator.h and for me it looks like that there were some other smells in the opcache package. Make still fails.



Test script:
---------------
Configure itself

Actual result:
--------------
Configure:
checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-05 14:17 UTC] reh at hebis dot uni-frankfurt dot de
Today I was able too complete the build. 
I had to add some Lines in configure and ZendAccelerator.h. (corresponding to <sys/fcntl.h>)
> # elif defined(__SVR4)
> #   define FLOCK_STRUCTURE(name, type, whence, start, len) \
>          struct flock name = {type, whence, start, len, 0, 0, 0 }

Also it was necessary to translate some files of ext/opcache/ with dos2unix. Maybe the problem has been long lines concatunated whith "\CRNL" instead of "\NL"

Still it's a hack, not a tested solution. ;-)
 [2013-07-05 14:41 UTC] reh at hebis dot uni-frankfurt dot de
FAILED TEST SUMMARY
...
Test flock() function: Basic functionality [ext/standard/tests/file/flock_basic.phpt]
Test flock() function: Variations [ext/standard/tests/file/flock_variation.phpt]
...
 [2013-07-05 19:31 UTC] reh at hebis dot uni-frankfurt dot de
Last info before resigning. :-( Configure can't link to flock()
> configure:19164: checking for flock
> "conftest.c", line 161: warning: statement not reached
> Undefined symbol     first referenced in file
> flock                conftest.o

Maybe someone smarter than me, may use the informations on http://www.perkin.org.uk/posts/solaris-portability-flock.html
 [2013-07-14 14:25 UTC] tgburrin at yahoo dot com
reh's solution seems to work for me.
After converting the \r\n's to \n and fixing the three spots (configure, 
ext/opcache/ZendAccelerator.h, and ext/opcache/config.m4) where the flock test 
is done, I was able to configure and build successfully.  I haven't seen any 
issues so far.

using Solaris Studio 12.3 on:

# cc -V
cc: Sun C 5.12 SunOS_i386 2011/11/16
# uname -a
SunOS Heimdall 5.10 Generic_147148-26 i86pc i386 i86pc
 [2013-07-19 05:20 UTC] lj2007331 at gmail dot com
PHP Version:5.5.0 and 5.5.1
OS:CentOS release 6.4 (Final)
Kernel: 2.6.32-358.6.2.el6.i686

Error:
checking for mmap() using shm_open() shared memory support... no
checking for mmap() using regular file shared memory support... no
checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
make: *** No targets specified and no makefile found.  Stop.
make: *** No rule to make target `install'.  Stop.
 [2013-07-20 00:00 UTC] yohgaki@php.net
> checking for known struct flock definition... configure: error: Don't know how 
to define struct flock on this system, 

I don't have this problem with my Scientific Linux 6.4.
 [2013-07-20 03:11 UTC] lj2007331 at gmail dot com
I tested many times. Influence and Linux OS version.
CentOS 5 32/64bit and CentOS 6 64bit has been passed, but CentOS 6 32bit ./configure error: 
checking for known struct flock definition... configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
 [2013-07-20 10:29 UTC] reh at hebis dot uni-frankfurt dot de
For me it looks like two probs.
1. Lineterminators
2. Flock library

Both seems to be tested only with GCC (1) and GLIBC (2) which is likely standard on most linux systems. It is just a question of the portability of the code.
 [2013-09-16 16:17 UTC] skrueger at europe dot com
Guys, since you already got it working, how about providing a patch?
 [2013-10-04 20:47 UTC] reh at hebis dot uni-frankfurt dot de
Sorry, but I can't provide a patch. 
My solution from the first post is roughly a workaround, to get the code compiled. But 'make test' still fails.
My skills as c-programmer are too poor, to understand the system librarys in detail. :-(
 [2013-11-14 17:54 UTC] jdahan80 at gmail dot com
I had the same problem trying to compile in CentOS 6.4.

I needed to install libtool-ltdl-devel and then the problem went away.
 [2014-02-06 21:04 UTC] stadtkind2 at gmx dot de
Bug seems to be gone in PHP 5.5.9. Compiling with '--enable-opcache' works fine, loading the module in php.ini + opcache.enable=1 works as well. phpinfo() confirms that opcache is up and running.

Tested with Solaris 11.1 x86/amd64 + Solaris Studio 12.3
 [2014-03-09 19:15 UTC] sjnims at gmail dot com
I've tried on PHP-5.5.10 and -5.5.9 with libmcrypt-2.5.8 with no success. I have confirmed that removing "--with-mcrypt..." allows configure to complete successfully. It should be noted that I am doing this on Heroku.

My libmcrypt configure directives:

./configure --prefix=/app/vendor/mcrypt \
            --disable-posix-threads \
            --enable-dynamic-loading

My PHP configure directives:

./configure --prefix=/app/vendor/php \
            --with-mysqli \
            --with-gd \
            --with-curl=/usr/lib \
            --with-config-file-path=/app/vendor/php \
            --with-openssl \
            --enable-fpm \
            --with-zlib \
            --enable-mbstring \
            --disable-debug \
            --disable-rpath \
            --enable-gd-native-ttf \
            --enable-inline-optimization \
            --with-bz2 \
            --with-mhash \
            --enable-zip \
            --with-gettext \
            --with-jpeg-dir=/usr \
            --with-png-dir=/usr \
            --enable-exif \
            --enable-bcmath \
            --enable-calendar \
            --enable-sockets \
            --with-xmlrpc \
            --with-mcrypt=/app/vendor/mcrypt \
            --without-pdo-sqlite \
            --without-sqlite3
 [2014-03-10 01:59 UTC] sjnims at gmail dot com
Per changelog (http://www.php.net/ChangeLog-5.php#5.5.0), the Zend Opcache extension was enabled by default since 5.5.0. Otherwise, the extension was available for install from PECL. Not sure what happens behind the scenes in a default compilation of version 5.5.x vs compiling a lesser version and installing the extension via PECL, but something doesn't seem to be working correctly in 5.5.x.

Personally, my main concern was that I'd hit some impasse, and that disabling the opcache extension would be a "game ender." As it is, the extension wasn't enabled by default as recent as the 5.4.x branch, so I think I can argue that disabling it is acceptable for the time being. I'm also using mecachier and nginx, and won't be serving too much to begin with, so I'm fine with disabling it.

I am interested to see what comes of this bug. Any extension to help speed up the response time of our apps is a good idea to me.
 [2014-05-02 08:11 UTC] leehanxue at gmail dot com
Could be be similar to https://bugs.php.net/bug.php?id=65423 ? Try installing libtdl-dev, or otherwise the complete GNU Libtool installation that includes libtdl. 

Libtdl is required for Opscache compilation. 


Hope that helps.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 15 02:01:24 2019 UTC