php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #70067 Cross-compile failure in opcache when SIZEOF_ZEND_LONG < SIZEOF_SIZE_T
Submitted: 2015-07-13 20:43 UTC Modified: -
From: bishop@php.net Assigned:
Status: Closed Package: Compile Failure
PHP Version: master-Git-2015-07-13 (Git) OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bishop@php.net
New email:
PHP Version: OS:

 

 [2015-07-13 20:43 UTC] bishop@php.net
Description:
------------
Using gcc -m32 to compile 32-bit version of PHP CLI on a 64-bit system.  Failure occurs in ext/opcache/zend_accelerator_util_funcs.c, where the macro definition of accel_xlat_get to zend_hash_str_find_ptr does not match implementation.

Running ./configure --enable-opcache=no bypasses this error.

Test script:
---------------
$ uname -a
Linux m.i.re 3.14.44-32.39.amzn1.x86_64 #1 SMP Thu Jun 11 20:33:38 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

$ EXTRA_CFLAGS=-m32 make

Actual result:
--------------
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c: In function ‘zend_clone_zval’:
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:160:36: error: macro "accel_xlat_get" requires 2 arguments, but only 1 given
   ptr = accel_xlat_get(Z_REF_P(src));
                                    ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:160:9: error: ‘accel_xlat_get’ undeclared (first use in this function)
   ptr = accel_xlat_get(Z_REF_P(src));
         ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:160:9: note: each undeclared identifier is reported only once for each function it appears in
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:168:4: warning: passing argument 4 of ‘zend_hash_str_add_new_ptr’ makes pointer from integer without a cast [enabled by default]
    accel_xlat_set(old, Z_REF_P(src));
    ^
In file included from /tmp/php-src/Zend/zend.h:36:0,
                 from /tmp/php-src/Zend/zend_modules.h:25,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:22:
/tmp/php-src/Zend/zend_hash.h:497:33: note: expected ‘void *’ but argument is of type ‘unsigned int’
 static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t len, void *pData)
                                 ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:168:4: error: too many arguments to function ‘zend_hash_str_add_new_ptr’
    accel_xlat_set(old, Z_REF_P(src));
    ^
In file included from /tmp/php-src/Zend/zend.h:36:0,
                 from /tmp/php-src/Zend/zend_modules.h:25,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:22:
/tmp/php-src/Zend/zend_hash.h:497:33: note: declared here
 static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t len, void *pData)
                                 ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:168:37: error: expected ‘)’ before ‘;’ token
    accel_xlat_set(old, Z_REF_P(src));
                                     ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:170:3: error: expected ‘;’ before ‘}’ token
   }
   ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:173:66: error: macro "accel_xlat_get" requires 2 arguments, but only 1 given
   if (Z_REFCOUNT_P(src) > 1 && (ptr = accel_xlat_get(Z_AST_P(src))) != NULL) {
                                                                  ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:181:5: warning: passing argument 4 of ‘zend_hash_str_add_new_ptr’ makes pointer from integer without a cast [enabled by default]
     accel_xlat_set(old, Z_AST_P(src));
     ^
In file included from /tmp/php-src/Zend/zend.h:36:0,
                 from /tmp/php-src/Zend/zend_modules.h:25,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:22:
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:181:5: warning: passing argument 4 of ‘zend_hash_str_add_new_ptr’ makes pointer from integer without a cast [enabled by default]
     accel_xlat_set(old, Z_AST_P(src));
     ^
In file included from /tmp/php-src/Zend/zend.h:36:0,
                 from /tmp/php-src/Zend/zend_modules.h:25,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:22:

/tmp/php-src/Zend/zend_hash.h:497:33: note: expected ‘void *’ but argument is of type ‘unsigned int’
 static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t len, void *pData)
                                 ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:181:5: error: too many arguments to function ‘zend_hash_str_add_new_ptr’
     accel_xlat_set(old, Z_AST_P(src));
     ^
In file included from /tmp/php-src/Zend/zend.h:36:0,
                 from /tmp/php-src/Zend/zend_modules.h:25,
                 from /tmp/php-src/Zend/zend_API.h:26,
                 from /tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:22:
/tmp/php-src/Zend/zend_hash.h:497:33: note: declared here
 static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t len, void *pData)
                                 ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:181:38: error: expected ‘)’ before ‘;’ token
     accel_xlat_set(old, Z_AST_P(src));
                                      ^
/tmp/php-src/ext/opcache/zend_accelerator_util_funcs.c:182:4: error: expected ‘;’ before ‘}’ token
    }
    ^
make: *** [ext/opcache/zend_accelerator_util_funcs.lo] Error 1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-07-14 11:09 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=453ec91dfe0ce53e1867241625958f27fbee17d2
Log: Fixed bug #70067 (Cross-compile failure in opcache when SIZEOF_ZEND_LONG &lt; SIZEOF_SIZE_T)
 [2015-07-14 11:09 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-07-21 14:20 UTC] ab@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=453ec91dfe0ce53e1867241625958f27fbee17d2
Log: Fixed bug #70067 (Cross-compile failure in opcache when SIZEOF_ZEND_LONG &lt; SIZEOF_SIZE_T)
 [2016-07-20 11:37 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=453ec91dfe0ce53e1867241625958f27fbee17d2
Log: Fixed bug #70067 (Cross-compile failure in opcache when SIZEOF_ZEND_LONG &lt; SIZEOF_SIZE_T)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 10:01:38 2025 UTC