php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70991 zend_file_cache.c:710: error: array type has incomplete element type
Submitted: 2015-11-28 21:25 UTC Modified: 2015-12-03 23:36 UTC
From: swa at section66 dot com Assigned: laruence
Status: Closed Package: Compile Failure
PHP Version: 7.0.0 OS: OpenBSD
Private report: No CVE-ID:
 [2015-11-28 21:25 UTC] swa at section66 dot com
Description:
------------
CFLAGS='-O2' './configure' '--prefix=/<PATH>/php-7.0.0RC8' '--with-apxs2=<PATH>/bin/apxs' '--with-zlib' '--with-gd' '--enable-exif' '--with-jpeg-dir=/usr/local/lib' '--enable-gd-native-ttf' '--with-zlib-dir=/usr/lib/' '--with-png-dir=/usr/local/' '--enable-ftp' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-config-file-path=/etc/php.ini' '--enable-mbstring'

(or even a plain ./configure without ANY options)

After a while (depending on what options were selected):

/<PATH>/php-7.0.0RC8/ext/opcache/zend_file_cache.c:710: error: array type has incomplete element type
*** Error code 1

Line 710:

#ifndef ZEND_WIN32
        struct iovec vec[3];
#endif


iovec on OpenBSD is defined in sys/uio.h, I guess the ./configure missed that.

[Not familiar with it enough myself to propose a fix, sorry]



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-11-29 03:16 UTC] laruence@php.net
-Status: Open +Status: Feedback
 [2015-11-29 03:16 UTC] laruence@php.net
can you verify this fix?

diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4
index fbe18f8..497aa4c 100644
--- a/ext/opcache/config.m4
+++ b/ext/opcache/config.m4
@@ -26,6 +26,8 @@ if test "$PHP_OPCACHE" != "no"; then
     AC_DEFINE(HAVE_MPROTECT, 1, [Define if you have mprotect() function])
   ])
 
+  AC_CHECK_HEADERS([unistd.h sys/uio.h])
+
   AC_MSG_CHECKING(for sysvipc shared memory support)
   AC_TRY_RUN([
 #include <sys/types.h>
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 7c615e9..993358b 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -706,7 +706,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
 	int fd;
 	char *filename;
 	zend_file_cache_metainfo info;
-#ifndef ZEND_WIN32
+#ifdef HAVE_SYS_UIO_H
 	struct iovec vec[3];
 #endif
 	void *mem, *buf;
@@ -761,7 +761,7 @@ int zend_file_cache_script_store(zend_persistent_script *script, int in_shm)
 	info.checksum = zend_adler32(ADLER32_INIT, buf, script->size);
 	info.checksum = zend_adler32(info.checksum, (signed char*)ZSTR_VAL((zend_string*)ZCG(mem)), info.str_size);
 
-#ifndef ZEND_WIN32
+#ifdef HAVE_SYS_UIO_H
 	vec[0].iov_base = &info;
 	vec[0].iov_len = sizeof(info);
 	vec[1].iov_base = buf;



note before you make, you should do ./buildconf --force to regenerate ./configure
 [2015-11-29 03:16 UTC] laruence@php.net
-Assigned To: +Assigned To: laruence
 [2015-11-29 03:22 UTC] laruence@php.net
I don't have openBSD box, so I can not verify it, and please make sure the HAVE_SYS_UIO_H is defined in main/php_config.h

1. ./buildconf --force .
2. ./configure 
3. make
 [2015-12-01 02:35 UTC] laruence@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ed4b887cf6e59c12428ebece5492201c63bfbb4f
Log: Fixed bug #70991 (zend_file_cache.c:710: error: array type has incomplete element type)
 [2015-12-01 02:35 UTC] laruence@php.net
-Status: Feedback +Status: Closed
 [2015-12-03 22:54 UTC] swa at section66 dot com
-PHP Version: 7.0.0RC8 +PHP Version: 7.0.0
 [2015-12-03 22:54 UTC] swa at section66 dot com
PHP 7.0.0 still has the same identical problem.

Testing the proposed fix to config.m4 fails so far on not having autoconf installed (and being aboard).
 [2015-12-03 23:36 UTC] swa at section66 dot com
Tried dropping an autoconf package on a test system (not part of my regular builds). 
Not very successful as far as I can tell, the ./buildconf --force eventually regenerates a main/php_config.h.in but it differs greatly from the original and after that all compilation fails form the very first file it compiles. 
The autoconf probably just is not working properly (or my lack of experience with it is showing).
 [2016-07-20 11:35 UTC] davey@php.net
Automatic comment on behalf of laruence@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ed4b887cf6e59c12428ebece5492201c63bfbb4f
Log: Fixed bug #70991 (zend_file_cache.c:710: error: array type has incomplete element type)
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sat Apr 29 17:01:36 2017 UTC